<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


The @TyCon@ datatype
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP, FlexibleInstances #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.TyCon</span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Main TyCon data types</span></span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier">TyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier">AlgTyConRhs</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier">visibleDataCons</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier">AlgTyConFlav</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isNoParent"><span class="hs-identifier">isNoParent</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier">FamTyConFlav</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier">Role</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier">Injectivity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRepInfo"><span class="hs-identifier">RuntimeRepInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier">TyConFlavour</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><span class="hs-comment">-- * TyConBinder</span></span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier">TyConBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier">TyConBndrVis</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConTyCoBinder"><span class="hs-identifier">TyConTyCoBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkNamedTyConBinder"><span class="hs-identifier">mkNamedTyConBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#mkNamedTyConBinders"><span class="hs-identifier">mkNamedTyConBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkRequiredTyConBinder"><span class="hs-identifier">mkRequiredTyConBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkAnonTyConBinder"><span class="hs-identifier">mkAnonTyConBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#mkAnonTyConBinders"><span class="hs-identifier">mkAnonTyConBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinderArgFlag"><span class="hs-identifier">tyConBinderArgFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier">tyConBndrVisArgFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isNamedTyConBinder"><span class="hs-identifier">isNamedTyConBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isVisibleTyConBinder"><span class="hs-identifier">isVisibleTyConBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isInvisibleTyConBinder"><span class="hs-identifier">isInvisibleTyConBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Field labels</span></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFieldLabels"><span class="hs-identifier">tyConFieldLabels</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#lookupTyConFieldLabel"><span class="hs-identifier">lookupTyConFieldLabel</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Constructing TyCons</span></span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkAlgTyCon"><span class="hs-identifier">mkAlgTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkClassTyCon"><span class="hs-identifier">mkClassTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkFunTyCon"><span class="hs-identifier">mkFunTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkPrimTyCon"><span class="hs-identifier">mkPrimTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkKindTyCon"><span class="hs-identifier">mkKindTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkLiftedPrimTyCon"><span class="hs-identifier">mkLiftedPrimTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkTupleTyCon"><span class="hs-identifier">mkTupleTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkSumTyCon"><span class="hs-identifier">mkSumTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkDataTyConRhs"><span class="hs-identifier">mkDataTyConRhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkSynonymTyCon"><span class="hs-identifier">mkSynonymTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkFamilyTyCon"><span class="hs-identifier">mkFamilyTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkPromotedDataCon"><span class="hs-identifier">mkPromotedDataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkTcTyCon"><span class="hs-identifier">mkTcTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#noTcTyConScopedTyVars"><span class="hs-identifier">noTcTyConScopedTyVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Predicates on TyCons</span></span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier">isAlgTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isVanillaAlgTyCon"><span class="hs-identifier">isVanillaAlgTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isConstraintKindCon"><span class="hs-identifier">isConstraintKindCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isClassTyCon"><span class="hs-identifier">isClassTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isFamInstTyCon"><span class="hs-identifier">isFamInstTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isFunTyCon"><span class="hs-identifier">isFunTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isPrimTyCon"><span class="hs-identifier">isPrimTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTupleTyCon"><span class="hs-identifier">isTupleTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier">isUnboxedTupleTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isBoxedTupleTyCon"><span class="hs-identifier">isBoxedTupleTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedSumTyCon"><span class="hs-identifier">isUnboxedSumTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedTupleTyCon"><span class="hs-identifier">isPromotedTupleTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-identifier">isTypeSynonymTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mustBeSaturated"><span class="hs-identifier">mustBeSaturated</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon"><span class="hs-identifier">isPromotedDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon_maybe"><span class="hs-identifier">isPromotedDataCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isKindTyCon"><span class="hs-identifier">isKindTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isLiftedTypeKindTyConName"><span class="hs-identifier">isLiftedTypeKindTyConName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTauTyCon"><span class="hs-identifier">isTauTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isFamFreeTyCon"><span class="hs-identifier">isFamFreeTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier">isDataTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isProductTyCon"><span class="hs-identifier">isProductTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isDataProductTyCon_maybe"><span class="hs-identifier">isDataProductTyCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isDataSumTyCon_maybe"><span class="hs-identifier">isDataSumTyCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isEnumerationTyCon"><span class="hs-identifier">isEnumerationTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier">isNewTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isAbstractTyCon"><span class="hs-identifier">isAbstractTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isFamilyTyCon"><span class="hs-identifier">isFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenFamilyTyCon"><span class="hs-identifier">isOpenFamilyTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier">isTypeFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isDataFamilyTyCon"><span class="hs-identifier">isDataFamilyTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenTypeFamilyTyCon"><span class="hs-identifier">isOpenTypeFamilyTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isClosedSynFamilyTyConWithAxiom_maybe"><span class="hs-identifier">isClosedSynFamilyTyConWithAxiom_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConInjectivityInfo"><span class="hs-identifier">tyConInjectivityInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isBuiltInSynFamTyCon_maybe"><span class="hs-identifier">isBuiltInSynFamTyCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier">isUnliftedTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isGadtSyntaxTyCon"><span class="hs-identifier">isGadtSyntaxTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier">isInjectiveTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isGenerativeTyCon"><span class="hs-identifier">isGenerativeTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier">isGenInjAlgRhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConAssoc"><span class="hs-identifier">isTyConAssoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConAssoc_maybe"><span class="hs-identifier">tyConAssoc_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier">tyConFlavourAssoc_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier">isImplicitTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier">isTyConWithSrcDataCons</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTcTyCon"><span class="hs-identifier">isTcTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#setTcTyConKind"><span class="hs-identifier">setTcTyConKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier">isTcLevPoly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Extracting information out of TyCons</span></span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier">tyConName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSkolem"><span class="hs-identifier">tyConSkolem</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier">tyConKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier">tyConUnique</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier">tyConTyVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConVisibleTyVars"><span class="hs-identifier">tyConVisibleTyVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier">tyConCType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConCType_maybe"><span class="hs-identifier">tyConCType_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-84"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier">tyConDataCons</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier">tyConDataCons_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier">tyConSingleDataCon_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleDataCon"><span class="hs-identifier">tyConSingleDataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleAlgDataCon_maybe"><span class="hs-identifier">tyConSingleAlgDataCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-87"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier">tyConFamilySize</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-88"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConStupidTheta"><span class="hs-identifier">tyConStupidTheta</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier">tyConArity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRoles"><span class="hs-identifier">tyConRoles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier">tyConFlavour</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConTuple_maybe"><span class="hs-identifier">tyConTuple_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConClass_maybe"><span class="hs-identifier">tyConClass_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConATs"><span class="hs-identifier">tyConATs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-93"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInst_maybe"><span class="hs-identifier">tyConFamInst_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInstSig_maybe"><span class="hs-identifier">tyConFamInstSig_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyCoercion_maybe"><span class="hs-identifier">tyConFamilyCoercion_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyResVar_maybe"><span class="hs-identifier">tyConFamilyResVar_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-95"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConDefn_maybe"><span class="hs-identifier">synTyConDefn_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConRhs_maybe"><span class="hs-identifier">synTyConRhs_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#famTyConFlav_maybe"><span class="hs-identifier">famTyConFlav_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#famTcResVar"><span class="hs-identifier">famTcResVar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#algTyConRhs"><span class="hs-identifier">algTyConRhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConRhs"><span class="hs-identifier">newTyConRhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadArity"><span class="hs-identifier">newTyConEtadArity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadRhs"><span class="hs-identifier">newTyConEtadRhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyCon_maybe"><span class="hs-identifier">unwrapNewTyCon_maybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyConEtad_maybe"><span class="hs-identifier">unwrapNewTyConEtad_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-100"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConDataCon_maybe"><span class="hs-identifier">newTyConDataCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-101"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier">algTcFields</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRuntimeRepInfo"><span class="hs-identifier">tyConRuntimeRepInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier">tyConBinders</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier">tyConResKind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConInvisTVBinders"><span class="hs-identifier">tyConInvisTVBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tcTyConScopedTyVars"><span class="hs-identifier">tcTyConScopedTyVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tcTyConIsPoly"><span class="hs-identifier">tcTyConIsPoly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkTyConTagMap"><span class="hs-identifier">mkTyConTagMap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Manipulating TyCons</span></span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#expandSynTyCon_maybe"><span class="hs-identifier">expandSynTyCon_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-109"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConCo"><span class="hs-identifier">newTyConCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConCo_maybe"><span class="hs-identifier">newTyConCo_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#pprPromotionQuote"><span class="hs-identifier">pprPromotionQuote</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier">mkTyConKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Predicated on TyConFlavours</span></span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier">tcFlavourIsOpen</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Runtime type representation</span></span><span>
</span><span id="line-116"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier">TyConRepName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier">tyConRepName_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-117"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#mkPrelTyConRepName"><span class="hs-identifier">mkPrelTyConRepName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-118"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepModOcc"><span class="hs-identifier">tyConRepModOcc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Primitive representations of Types</span></span><span>
</span><span id="line-121"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier">PrimRep</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier">PrimElemRep</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#isVoidRep"><span class="hs-identifier">isVoidRep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier">isGcPtrRep</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier">primRepSizeB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-124"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier">primElemRepSizeB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-125"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier">primRepIsFloat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-126"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#primRepsCompatible"><span class="hs-identifier">primRepsCompatible</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-127"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#primRepCompatible"><span class="hs-identifier">primRepCompatible</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Recursion breaking</span></span><span>
</span><span id="line-130"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier">RecTcChecker</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#initRecTc"><span class="hs-identifier">initRecTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#defaultRecTcMaxBound"><span class="hs-identifier">defaultRecTcMaxBound</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-131"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#setRecTcMaxBound"><span class="hs-identifier">setRecTcMaxBound</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#checkRecTc"><span class="hs-identifier">checkRecTc</span></a></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-137"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-138"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html"><span class="hs-identifier">GHC.Core.TyCo.Rep</span></a></span><span>
</span><span id="line-141"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier">Kind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier">PredType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#mkForAllTy"><span class="hs-identifier">mkForAllTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#mkFunTyMany"><span class="hs-identifier">mkFunTyMany</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html"><span class="hs-identifier">GHC.Core.TyCo.Ppr</span></a></span><span>
</span><span id="line-143"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html#pprType"><span class="hs-identifier">pprType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-145"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#runtimeRepTyCon"><span class="hs-identifier">runtimeRepTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#constraintKind"><span class="hs-identifier">constraintKind</span></a></span><span>
</span><span id="line-146"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#multiplicityTyCon"><span class="hs-identifier">multiplicityTyCon</span></a></span><span>
</span><span id="line-147"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#vecCountTyCon"><span class="hs-identifier">vecCountTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#vecElemTyCon"><span class="hs-identifier">vecElemTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier">liftedTypeKind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-149"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier">DataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier">dataConExTyCoVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConFieldLabels"><span class="hs-identifier">dataConFieldLabels</span></a></span><span>
</span><span id="line-150"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConTyCon"><span class="hs-identifier">dataConTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConFullSig"><span class="hs-identifier">dataConFullSig</span></a></span><span>
</span><span id="line-151"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#isUnboxedSumCon"><span class="hs-identifier">isUnboxedSumCon</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Binary.html"><span class="hs-identifier">GHC.Utils.Binary</span></a></span><span>
</span><span id="line-154"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-155"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-156"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span>
</span><span id="line-157"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-158"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html"><span class="hs-identifier">GHC.Types.ForeignCall</span></a></span><span>
</span><span id="line-159"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-160"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-161"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html"><span class="hs-identifier">GHC.Core.Coercion.Axiom</span></a></span><span>
</span><span id="line-162"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-163"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-164"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-165"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.Env.html"><span class="hs-identifier">GHC.Data.FastString.Env</span></a></span><span>
</span><span id="line-166"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html"><span class="hs-identifier">GHC.Types.FieldLabel</span></a></span><span>
</span><span id="line-167"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Settings.Constants.html"><span class="hs-identifier">GHC.Settings.Constants</span></a></span><span>
</span><span id="line-168"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-169"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#tyConRepNameUnique"><span class="hs-identifier">tyConRepNameUnique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#dataConTyRepNameUnique"><span class="hs-identifier">dataConTyRepNameUnique</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span>
</span><span id="line-171"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Data</span></span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="hs-comment">{-
-----------------------------------------------
        Notes about type families
-----------------------------------------------

Note [Type synonym families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Type synonym families, also known as &quot;type functions&quot;, map directly
  onto the type functions in FC:

        type family F a :: *
        type instance F Int = Bool
        ..etc...

* Reply &quot;yes&quot; to isTypeFamilyTyCon, and isFamilyTyCon

* From the user's point of view (F Int) and Bool are simply
  equivalent types.

* A Haskell 98 type synonym is a degenerate form of a type synonym
  family.

* Type functions can't appear in the LHS of a type function:
        type instance F (F Int) = ...   -- BAD!

* Translation of type family decl:
        type family F a :: *
  translates to
    a FamilyTyCon 'F', whose FamTyConFlav is OpenSynFamilyTyCon

        type family G a :: * where
          G Int = Bool
          G Bool = Char
          G a = ()
  translates to
    a FamilyTyCon 'G', whose FamTyConFlav is ClosedSynFamilyTyCon, with the
    appropriate CoAxiom representing the equations

We also support injective type families -- see Note [Injective type families]

Note [Data type families]
~~~~~~~~~~~~~~~~~~~~~~~~~
See also Note [Wrappers for data instance tycons] in GHC.Types.Id.Make

* Data type families are declared thus
        data family T a :: *
        data instance T Int = T1 | T2 Bool

  Here T is the &quot;family TyCon&quot;.

* Reply &quot;yes&quot; to isDataFamilyTyCon, and isFamilyTyCon

* The user does not see any &quot;equivalent types&quot; as he did with type
  synonym families.  He just sees constructors with types
        T1 :: T Int
        T2 :: Bool -&gt; T Int

* Here's the FC version of the above declarations:

        data T a
        data R:TInt = T1 | T2 Bool
        axiom ax_ti : T Int ~R R:TInt

  Note that this is a *representational* coercion
  The R:TInt is the &quot;representation TyCons&quot;.
  It has an AlgTyConFlav of
        DataFamInstTyCon T [Int] ax_ti

* The axiom ax_ti may be eta-reduced; see
  Note [Eta reduction for data families] in GHC.Core.Coercion.Axiom

* Data family instances may have a different arity than the data family.
  See Note [Arity of data families] in GHC.Core.FamInstEnv

* The data constructor T2 has a wrapper (which is what the
  source-level &quot;T2&quot; invokes):

        $WT2 :: Bool -&gt; T Int
        $WT2 b = T2 b `cast` sym ax_ti

* A data instance can declare a fully-fledged GADT:

        data instance T (a,b) where
          X1 :: T (Int,Bool)
          X2 :: a -&gt; b -&gt; T (a,b)

  Here's the FC version of the above declaration:

        data R:TPair a b where
          X1 :: R:TPair Int Bool
          X2 :: a -&gt; b -&gt; R:TPair a b
        axiom ax_pr :: T (a,b)  ~R  R:TPair a b

        $WX1 :: forall a b. a -&gt; b -&gt; T (a,b)
        $WX1 a b (x::a) (y::b) = X2 a b x y `cast` sym (ax_pr a b)

  The R:TPair are the &quot;representation TyCons&quot;.
  We have a bit of work to do, to unpick the result types of the
  data instance declaration for T (a,b), to get the result type in the
  representation; e.g.  T (a,b) --&gt; R:TPair a b

  The representation TyCon R:TList, has an AlgTyConFlav of

        DataFamInstTyCon T [(a,b)] ax_pr

* Notice that T is NOT translated to a FC type function; it just
  becomes a &quot;data type&quot; with no constructors, which can be coerced
  into R:TInt, R:TPair by the axioms.  These axioms
  axioms come into play when (and *only* when) you
        - use a data constructor
        - do pattern matching
  Rather like newtype, in fact

  As a result

  - T behaves just like a data type so far as decomposition is concerned

  - (T Int) is not implicitly converted to R:TInt during type inference.
    Indeed the latter type is unknown to the programmer.

  - There *is* an instance for (T Int) in the type-family instance
    environment, but it is looked up (via tcLookupDataFamilyInst)
    in can_eq_nc (via tcTopNormaliseNewTypeTF_maybe) when trying to
    solve representational equalities like
         T Int ~R# Bool
    Here we look up (T Int), convert it to R:TInt, and then unwrap the
    newtype R:TInt.

    It is also looked up in reduceTyFamApp_maybe.

  - It's fine to have T in the LHS of a type function:
    type instance F (T a) = [a]

  It was this last point that confused me!  The big thing is that you
  should not think of a data family T as a *type function* at all, not
  even an injective one!  We can't allow even injective type functions
  on the LHS of a type function:
        type family injective G a :: *
        type instance F (G Int) = Bool
  is no good, even if G is injective, because consider
        type instance G Int = Bool
        type instance F Bool = Char

  So a data type family is not an injective type function. It's just a
  data type with some axioms that connect it to other data types.

* The tyConTyVars of the representation tycon are the tyvars that the
  user wrote in the patterns. This is important in GHC.Tc.Deriv, where we
  bring these tyvars into scope before type-checking the deriving
  clause. This fact is arranged for in TcInstDecls.tcDataFamInstDecl.

Note [Associated families and their parent class]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Associated* families are just like *non-associated* families, except
that they have a famTcParent field of (Just cls_tc), which identifies the
parent class.

However there is an important sharing relationship between
  * the tyConTyVars of the parent Class
  * the tyConTyVars of the associated TyCon

   class C a b where
     data T p a
     type F a q b

Here the 'a' and 'b' are shared with the 'Class'; that is, they have
the same Unique.

This is important. In an instance declaration we expect
  * all the shared variables to be instantiated the same way
  * the non-shared variables of the associated type should not
    be instantiated at all

  instance C [x] (Tree y) where
     data T p [x] = T1 x | T2 p
     type F [x] q (Tree y) = (x,y,q)

Note [TyCon Role signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Every tycon has a role signature, assigning a role to each of the tyConTyVars
(or of equal length to the tyConArity, if there are no tyConTyVars). An
example demonstrates these best: say we have a tycon T, with parameters a at
nominal, b at representational, and c at phantom. Then, to prove
representational equality between T a1 b1 c1 and T a2 b2 c2, we need to have
nominal equality between a1 and a2, representational equality between b1 and
b2, and nothing in particular (i.e., phantom equality) between c1 and c2. This
might happen, say, with the following declaration:

  data T a b c where
    MkT :: b -&gt; T Int b c

Data and class tycons have their roles inferred (see inferRoles in GHC.Tc.TyCl.Utils),
as do vanilla synonym tycons. Family tycons have all parameters at role N,
though it is conceivable that we could relax this restriction. (-&gt;)'s and
tuples' parameters are at role R. Each primitive tycon declares its roles;
it's worth noting that (~#)'s parameters are at role N. Promoted data
constructors' type arguments are at role R. All kind arguments are at role
N.

Note [Unboxed tuple RuntimeRep vars]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The contents of an unboxed tuple may have any representation. Accordingly,
the kind of the unboxed tuple constructor is runtime-representation
polymorphic.

Type constructor (2 kind arguments)
   (#,#) :: forall (q :: RuntimeRep) (r :: RuntimeRep).
                   TYPE q -&gt; TYPE r -&gt; TYPE (TupleRep [q, r])
Data constructor (4 type arguments)
   (#,#) :: forall (q :: RuntimeRep) (r :: RuntimeRep)
                   (a :: TYPE q) (b :: TYPE r). a -&gt; b -&gt; (# a, b #)

These extra tyvars (q and r) cause some delicate processing around tuples,
where we need to manually insert RuntimeRep arguments.
The same situation happens with unboxed sums: each alternative
has its own RuntimeRep.
For boxed tuples, there is no levity polymorphism, and therefore
we add RuntimeReps only for the unboxed version.

Type constructor (no kind arguments)
   (,) :: Type -&gt; Type -&gt; Type
Data constructor (2 type arguments)
   (,) :: forall a b. a -&gt; b -&gt; (a, b)


Note [Injective type families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We allow injectivity annotations for type families (both open and closed):

  type family F (a :: k) (b :: k) = r | r -&gt; a
  type family G a b = res | res -&gt; a b where ...

Injectivity information is stored in the `famTcInj` field of `FamilyTyCon`.
`famTcInj` maybe stores a list of Bools, where each entry corresponds to a
single element of `tyConTyVars` (both lists should have identical length). If no
injectivity annotation was provided `famTcInj` is Nothing. From this follows an
invariant that if `famTcInj` is a Just then at least one element in the list
must be True.

See also:
 * [Injectivity annotation] in GHC.Hs.Decls
 * [Renaming injectivity annotation] in GHC.Rename.Module
 * [Verifying injectivity annotation] in GHC.Core.FamInstEnv
 * [Type inference for type families with injectivity] in GHC.Tc.Solver.Interact

************************************************************************
*                                                                      *
                    TyConBinder, TyConTyCoBinder
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span class="hs-keyword">type</span><span> </span><span id="TyConBinder"><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-var">TyConBinder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span class="hs-comment">-- In the whole definition of @data TyCon@, only @PromotedDataCon@ will really</span><span>
</span><span id="line-430"></span><span class="hs-comment">-- contain CoVar.</span><span>
</span><span id="line-431"></span><span class="hs-keyword">type</span><span> </span><span id="TyConTyCoBinder"><span class="annot"><a href="GHC.Core.TyCon.html#TyConTyCoBinder"><span class="hs-identifier hs-var">TyConTyCoBinder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span class="hs-keyword">data</span><span> </span><span id="TyConBndrVis"><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-var">TyConBndrVis</span></a></span></span><span>
</span><span id="line-434"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="NamedTCB"><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-var">NamedTCB</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span>
</span><span id="line-435"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="AnonTCB"><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-var">AnonTCB</span></a></span></span><span>  </span><span class="annot"><a href="GHC.Types.Var.html#AnonArgFlag"><span class="hs-identifier hs-type">AnonArgFlag</span></a></span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815626"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-438"></span><span>  </span><span id="local-6989586621680815620"><span class="annot"><span class="annottext">ppr :: TyConBndrVis -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span id="local-6989586621680815618"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815618"><span class="hs-identifier hs-var">flag</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;NamedTCB&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815618"><span class="hs-identifier hs-var">flag</span></a></span><span>
</span><span id="line-439"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span id="local-6989586621680815615"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815615"><span class="hs-identifier hs-var">af</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;AnonTCB&quot;</span></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815615"><span class="hs-identifier hs-var">af</span></a></span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkAnonTyConBinder"><span class="hs-identifier hs-type">mkAnonTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#AnonArgFlag"><span class="hs-identifier hs-type">AnonArgFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span>
</span><span id="line-442"></span><span id="mkAnonTyConBinder"><span class="annot"><span class="annottext">mkAnonTyConBinder :: AnonArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkAnonTyConBinder"><span class="hs-identifier hs-var hs-var">mkAnonTyConBinder</span></a></span></span><span> </span><span id="local-6989586621680815614"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815614"><span class="hs-identifier hs-var">af</span></a></span></span><span> </span><span id="local-6989586621680815613"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815613"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isTyVar</span><span> </span><span class="hs-identifier">tv</span><span class="hs-special">)</span><span>
</span><span id="line-443"></span><span>                          </span><span class="annot"><span class="annottext">TyVar -&gt; TyConBndrVis -&gt; TyConBinder
forall var argf. var -&gt; argf -&gt; VarBndr var argf
</span><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-var">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815613"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnonArgFlag -&gt; TyConBndrVis
</span><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-var">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815614"><span class="hs-identifier hs-var">af</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkAnonTyConBinders"><span class="hs-identifier hs-type">mkAnonTyConBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#AnonArgFlag"><span class="hs-identifier hs-type">AnonArgFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-446"></span><span id="mkAnonTyConBinders"><span class="annot"><span class="annottext">mkAnonTyConBinders :: AnonArgFlag -&gt; [TyVar] -&gt; [TyConBinder]
</span><a href="GHC.Core.TyCon.html#mkAnonTyConBinders"><span class="hs-identifier hs-var hs-var">mkAnonTyConBinders</span></a></span></span><span> </span><span id="local-6989586621680815606"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815606"><span class="hs-identifier hs-var">af</span></a></span></span><span> </span><span id="local-6989586621680815605"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815605"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyVar -&gt; TyConBinder) -&gt; [TyVar] -&gt; [TyConBinder]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnonArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkAnonTyConBinder"><span class="hs-identifier hs-var">mkAnonTyConBinder</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815606"><span class="hs-identifier hs-var">af</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815605"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkNamedTyConBinder"><span class="hs-identifier hs-type">mkNamedTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span>
</span><span id="line-449"></span><span class="hs-comment">-- The odd argument order supports currying</span><span>
</span><span id="line-450"></span><span id="mkNamedTyConBinder"><span class="annot"><span class="annottext">mkNamedTyConBinder :: ArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkNamedTyConBinder"><span class="hs-identifier hs-var hs-var">mkNamedTyConBinder</span></a></span></span><span> </span><span id="local-6989586621680815604"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815604"><span class="hs-identifier hs-var">vis</span></a></span></span><span> </span><span id="local-6989586621680815603"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815603"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isTyVar</span><span> </span><span class="hs-identifier">tv</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span>                            </span><span class="annot"><span class="annottext">TyVar -&gt; TyConBndrVis -&gt; TyConBinder
forall var argf. var -&gt; argf -&gt; VarBndr var argf
</span><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-var">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815603"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgFlag -&gt; TyConBndrVis
</span><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-var">NamedTCB</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815604"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkNamedTyConBinders"><span class="hs-identifier hs-type">mkNamedTyConBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-454"></span><span class="hs-comment">-- The odd argument order supports currying</span><span>
</span><span id="line-455"></span><span id="mkNamedTyConBinders"><span class="annot"><span class="annottext">mkNamedTyConBinders :: ArgFlag -&gt; [TyVar] -&gt; [TyConBinder]
</span><a href="GHC.Core.TyCon.html#mkNamedTyConBinders"><span class="hs-identifier hs-var hs-var">mkNamedTyConBinders</span></a></span></span><span> </span><span id="local-6989586621680815602"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815602"><span class="hs-identifier hs-var">vis</span></a></span></span><span> </span><span id="local-6989586621680815601"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815601"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyVar -&gt; TyConBinder) -&gt; [TyVar] -&gt; [TyConBinder]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkNamedTyConBinder"><span class="hs-identifier hs-var">mkNamedTyConBinder</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815602"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815601"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">-- | Make a Required TyConBinder. It chooses between NamedTCB and</span><span>
</span><span id="line-458"></span><span class="hs-comment">-- AnonTCB based on whether the tv is mentioned in the dependent set</span><span>
</span><span id="line-459"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkRequiredTyConBinder"><span class="hs-identifier hs-type">mkRequiredTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>  </span><span class="hs-comment">-- these are used dependently</span><span>
</span><span id="line-460"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span>
</span><span id="line-461"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span>
</span><span id="line-462"></span><span id="mkRequiredTyConBinder"><span class="annot"><span class="annottext">mkRequiredTyConBinder :: TyCoVarSet -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkRequiredTyConBinder"><span class="hs-identifier hs-var hs-var">mkRequiredTyConBinder</span></a></span></span><span> </span><span id="local-6989586621680815600"><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621680815600"><span class="hs-identifier hs-var">dep_set</span></a></span></span><span> </span><span id="local-6989586621680815599"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815599"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-463"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815599"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; TyCoVarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621680815600"><span class="hs-identifier hs-var">dep_set</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkNamedTyConBinder"><span class="hs-identifier hs-var">mkNamedTyConBinder</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Required"><span class="hs-identifier hs-var">Required</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815599"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-464"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnonArgFlag -&gt; TyVar -&gt; TyConBinder
</span><a href="GHC.Core.TyCon.html#mkAnonTyConBinder"><span class="hs-identifier hs-var">mkAnonTyConBinder</span></a></span><span>  </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#VisArg"><span class="hs-identifier hs-var">VisArg</span></a></span><span>   </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815599"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinderArgFlag"><span class="hs-identifier hs-type">tyConBinderArgFlag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span>
</span><span id="line-467"></span><span id="tyConBinderArgFlag"><span class="annot"><span class="annottext">tyConBinderArgFlag :: TyConBinder -&gt; ArgFlag
</span><a href="GHC.Core.TyCon.html#tyConBinderArgFlag"><span class="hs-identifier hs-var hs-var">tyConBinderArgFlag</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815595"><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815595"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; ArgFlag
</span><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier hs-var">tyConBndrVisArgFlag</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815595"><span class="hs-identifier hs-var">vis</span></a></span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier hs-type">tyConBndrVisArgFlag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#ArgFlag"><span class="hs-identifier hs-type">ArgFlag</span></a></span><span>
</span><span id="line-470"></span><span id="tyConBndrVisArgFlag"><span class="annot"><span class="annottext">tyConBndrVisArgFlag :: TyConBndrVis -&gt; ArgFlag
</span><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier hs-var hs-var">tyConBndrVisArgFlag</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span id="local-6989586621680815594"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815594"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815594"><span class="hs-identifier hs-var">vis</span></a></span><span>
</span><span id="line-471"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier hs-var">tyConBndrVisArgFlag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#VisArg"><span class="hs-identifier hs-var">VisArg</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Required"><span class="hs-identifier hs-var">Required</span></a></span><span>
</span><span id="line-472"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConBndrVisArgFlag"><span class="hs-identifier hs-var">tyConBndrVisArgFlag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#InvisArg"><span class="hs-identifier hs-var">InvisArg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Inferred"><span class="hs-identifier hs-var">Inferred</span></a></span><span>    </span><span class="hs-comment">-- See Note [AnonTCB InvisArg]</span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNamedTyConBinder"><span class="hs-identifier hs-type">isNamedTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-475"></span><span class="hs-comment">-- Identifies kind variables</span><span>
</span><span id="line-476"></span><span class="hs-comment">-- E.g. data T k (a:k) = blah</span><span>
</span><span id="line-477"></span><span class="hs-comment">-- Here 'k' is a NamedTCB, a variable used in the kind of other binders</span><span>
</span><span id="line-478"></span><span id="isNamedTyConBinder"><span class="annot"><span class="annottext">isNamedTyConBinder :: TyConBinder -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNamedTyConBinder"><span class="hs-identifier hs-var hs-var">isNamedTyConBinder</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-479"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNamedTyConBinder"><span class="hs-identifier hs-var">isNamedTyConBinder</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBinder
</span><span class="hs-identifier">_</span></span><span>                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span id="local-6989586621680816097"><span class="annot"><a href="GHC.Core.TyCon.html#isVisibleTyConBinder"><span class="hs-identifier hs-type">isVisibleTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680816097"><span class="hs-identifier hs-type">tv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-482"></span><span class="hs-comment">-- Works for IfaceTyConBinder too</span><span>
</span><span id="line-483"></span><span id="isVisibleTyConBinder"><span class="annot"><span class="annottext">isVisibleTyConBinder :: forall tv. VarBndr tv TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVisibleTyConBinder"><span class="hs-identifier hs-var hs-var">isVisibleTyConBinder</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span class="annot"><span class="annottext">tv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815591"><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815591"><span class="hs-identifier hs-var">tcb_vis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-var">isVisibleTcbVis</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815591"><span class="hs-identifier hs-var">tcb_vis</span></a></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-type">isVisibleTcbVis</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-486"></span><span id="isVisibleTcbVis"><span class="annot"><span class="annottext">isVisibleTcbVis :: TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-var hs-var">isVisibleTcbVis</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span id="local-6989586621680815589"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815589"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgFlag -&gt; Bool
</span><a href="GHC.Types.Var.html#isVisibleArgFlag"><span class="hs-identifier hs-var">isVisibleArgFlag</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815589"><span class="hs-identifier hs-var">vis</span></a></span><span>
</span><span id="line-487"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-var">isVisibleTcbVis</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#VisArg"><span class="hs-identifier hs-var">VisArg</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-488"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-var">isVisibleTcbVis</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#InvisArg"><span class="hs-identifier hs-var">InvisArg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-489"></span><span>
</span><span id="line-490"></span><span id="local-6989586621680815587"><span class="annot"><a href="GHC.Core.TyCon.html#isInvisibleTyConBinder"><span class="hs-identifier hs-type">isInvisibleTyConBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680815587"><span class="hs-identifier hs-type">tv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-491"></span><span class="hs-comment">-- Works for IfaceTyConBinder too</span><span>
</span><span id="line-492"></span><span id="isInvisibleTyConBinder"><span class="annot"><span class="annottext">isInvisibleTyConBinder :: forall tv. VarBndr tv TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isInvisibleTyConBinder"><span class="hs-identifier hs-var hs-var">isInvisibleTyConBinder</span></a></span></span><span> </span><span id="local-6989586621680815586"><span class="annot"><span class="annottext">VarBndr tv TyConBndrVis
</span><a href="#local-6989586621680815586"><span class="hs-identifier hs-var">tcb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarBndr tv TyConBndrVis -&gt; Bool
forall tv. VarBndr tv TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVisibleTyConBinder"><span class="hs-identifier hs-var">isVisibleTyConBinder</span></a></span><span> </span><span class="annot"><span class="annottext">VarBndr tv TyConBndrVis
</span><a href="#local-6989586621680815586"><span class="hs-identifier hs-var">tcb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="hs-comment">-- Build the 'tyConKind' from the binders and the result kind.</span><span>
</span><span id="line-495"></span><span class="hs-comment">-- Keep in sync with 'mkTyConKind' in GHC.Iface.Type.</span><span>
</span><span id="line-496"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-type">mkTyConKind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>
</span><span id="line-497"></span><span id="mkTyConKind"><span class="annot"><span class="annottext">mkTyConKind :: [TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var hs-var">mkTyConKind</span></a></span></span><span> </span><span id="local-6989586621680815585"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815585"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621680815584"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815584"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyConBinder -&gt; Kind -&gt; Kind) -&gt; Kind -&gt; [TyConBinder] -&gt; Kind
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBinder -&gt; Kind -&gt; Kind
</span><a href="#local-6989586621680815582"><span class="hs-identifier hs-var">mk</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815584"><span class="hs-identifier hs-var">res_kind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815585"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-498"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-499"></span><span>    </span><span class="annot"><a href="#local-6989586621680815582"><span class="hs-identifier hs-type">mk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>
</span><span id="line-500"></span><span>    </span><span id="local-6989586621680815582"><span class="annot"><span class="annottext">mk :: TyConBinder -&gt; Kind -&gt; Kind
</span><a href="#local-6989586621680815582"><span class="hs-identifier hs-var hs-var">mk</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680815581"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815581"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span id="local-6989586621680815580"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815580"><span class="hs-identifier hs-var">af</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span id="local-6989586621680815579"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815579"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnonArgFlag -&gt; Kind -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkFunTyMany"><span class="hs-identifier hs-var">mkFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815580"><span class="hs-identifier hs-var">af</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyVar -&gt; Kind
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815581"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815579"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-501"></span><span>    </span><span class="annot"><a href="#local-6989586621680815582"><span class="hs-identifier hs-var">mk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680815577"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815577"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span id="local-6989586621680815576"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815576"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621680815575"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815575"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyVar -&gt; ArgFlag -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkForAllTy"><span class="hs-identifier hs-var">mkForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815577"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815576"><span class="hs-identifier hs-var">vis</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815575"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-502"></span><span>
</span><span id="line-503"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConInvisTVBinders"><span class="hs-identifier hs-type">tyConInvisTVBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- From the TyCon</span><span>
</span><span id="line-504"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Suitable for the foralls of a term function</span><span>
</span><span id="line-505"></span><span class="hs-comment">-- See Note [Building TyVarBinders from TyConBinders]</span><span>
</span><span id="line-506"></span><span id="tyConInvisTVBinders"><span class="annot"><span class="annottext">tyConInvisTVBinders :: [TyConBinder] -&gt; [InvisTVBinder]
</span><a href="GHC.Core.TyCon.html#tyConInvisTVBinders"><span class="hs-identifier hs-var hs-var">tyConInvisTVBinders</span></a></span></span><span> </span><span id="local-6989586621680815574"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815574"><span class="hs-identifier hs-var">tc_bndrs</span></a></span></span><span>
</span><span id="line-507"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyConBinder -&gt; InvisTVBinder) -&gt; [TyConBinder] -&gt; [InvisTVBinder]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBinder -&gt; InvisTVBinder
</span><a href="#local-6989586621680815573"><span class="hs-identifier hs-var">mk_binder</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815574"><span class="hs-identifier hs-var">tc_bndrs</span></a></span><span>
</span><span id="line-508"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-509"></span><span>   </span><span id="local-6989586621680815573"><span class="annot"><span class="annottext">mk_binder :: TyConBinder -&gt; InvisTVBinder
</span><a href="#local-6989586621680815573"><span class="hs-identifier hs-var hs-var">mk_binder</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680815572"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815572"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680815571"><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815571"><span class="hs-identifier hs-var">tc_vis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Specificity -&gt; TyVar -&gt; InvisTVBinder
forall vis. vis -&gt; TyVar -&gt; VarBndr TyVar vis
</span><a href="GHC.Types.Var.html#mkTyVarBinder"><span class="hs-identifier hs-var">mkTyVarBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="#local-6989586621680815569"><span class="hs-identifier hs-var">vis</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815572"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-510"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-511"></span><span>        </span><span id="local-6989586621680815569"><span class="annot"><span class="annottext">vis :: Specificity
</span><a href="#local-6989586621680815569"><span class="hs-identifier hs-var hs-var">vis</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815571"><span class="hs-identifier hs-var">tc_vis</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-512"></span><span>                </span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#VisArg"><span class="hs-identifier hs-var">VisArg</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#SpecifiedSpec"><span class="hs-identifier hs-var">SpecifiedSpec</span></a></span><span>
</span><span id="line-513"></span><span>                </span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#InvisArg"><span class="hs-identifier hs-var">InvisArg</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span>   </span><span class="hs-comment">-- See Note [AnonTCB InvisArg]</span><span>
</span><span id="line-514"></span><span>                </span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Required"><span class="hs-identifier hs-var">Required</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#SpecifiedSpec"><span class="hs-identifier hs-var">SpecifiedSpec</span></a></span><span>
</span><span id="line-515"></span><span>                </span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Invisible"><span class="hs-identifier hs-type">Invisible</span></a></span><span> </span><span id="local-6989586621680815565"><span class="annot"><span class="annottext">Specificity
</span><a href="#local-6989586621680815565"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="#local-6989586621680815565"><span class="hs-identifier hs-var">vis</span></a></span><span>
</span><span id="line-516"></span><span>
</span><span id="line-517"></span><span class="hs-comment">-- Returns only tyvars, as covars are always inferred</span><span>
</span><span id="line-518"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConVisibleTyVars"><span class="hs-identifier hs-type">tyConVisibleTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-519"></span><span id="tyConVisibleTyVars"><span class="annot"><span class="annottext">tyConVisibleTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConVisibleTyVars"><span class="hs-identifier hs-var hs-var">tyConVisibleTyVars</span></a></span></span><span> </span><span id="local-6989586621680815564"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815564"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-520"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815563"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680815563"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680815563"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680815562"><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815562"><span class="hs-identifier hs-var">vis</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var hs-var">tyConBinders</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815564"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-521"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVisibleTcbVis"><span class="hs-identifier hs-var">isVisibleTcbVis</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815562"><span class="hs-identifier hs-var">vis</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">{- Note [AnonTCB InvisArg]
~~~~~~~~~~~~~~~~~~~~~~~~~~
It's pretty rare to have an (AnonTCB InvisArg) binder.  The
only way it can occur is through equality constraints in kinds. These
can arise in one of two ways:

* In a PromotedDataCon whose kind has an equality constraint:

    'MkT :: forall a b. (a~b) =&gt; blah

  See Note [Constraints in kinds] in GHC.Core.TyCo.Rep, and
  Note [Promoted data constructors] in this module.
* In a data type whose kind has an equality constraint, as in the
  following example from #12102:

    data T :: forall a. (IsTypeLit a ~ 'True) =&gt; a -&gt; Type

When mapping an (AnonTCB InvisArg) to an ArgFlag, in
tyConBndrVisArgFlag, we use &quot;Inferred&quot; to mean &quot;the user cannot
specify this arguments, even with visible type/kind application;
instead the type checker must fill it in.

We map (AnonTCB VisArg) to Required, of course: the user must
provide it. It would be utterly wrong to do this for constraint
arguments, which is why AnonTCB must have the AnonArgFlag in
the first place.

Note [Building TyVarBinders from TyConBinders]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We sometimes need to build the quantified type of a value from
the TyConBinders of a type or class.  For that we need not
TyConBinders but TyVarBinders (used in forall-type)  E.g:

 *  From   data T a = MkT (Maybe a)
    we are going to make a data constructor with type
           MkT :: forall a. Maybe a -&gt; T a
    See the TyCoVarBinders passed to buildDataCon

 * From    class C a where { op :: a -&gt; Maybe a }
   we are going to make a default method
           $dmop :: forall a. C a =&gt; a -&gt; Maybe a
   See the TyCoVarBinders passed to mkSigmaTy in mkDefaultMethodType

Both of these are user-callable.  (NB: default methods are not callable
directly by the user but rather via the code generated by 'deriving',
which uses visible type application; see mkDefMethBind.)

Since they are user-callable we must get their type-argument visibility
information right; and that info is in the TyConBinders.
Here is an example:

  data App a b = MkApp (a b) -- App :: forall {k}. (k-&gt;*) -&gt; k -&gt; *

The TyCon has

  tyConTyBinders = [ Named (Bndr (k :: *) Inferred), Anon (k-&gt;*), Anon k ]

The TyConBinders for App line up with App's kind, given above.

But the DataCon MkApp has the type
  MkApp :: forall {k} (a:k-&gt;*) (b:k). a b -&gt; App k a b

That is, its TyCoVarBinders should be

  dataConUnivTyVarBinders = [ Bndr (k:*)    Inferred
                            , Bndr (a:k-&gt;*) Specified
                            , Bndr (b:k)    Specified ]

So tyConTyVarBinders converts TyCon's TyConBinders into TyVarBinders:
  - variable names from the TyConBinders
  - but changing Anon/Required to Specified

The last part about Required-&gt;Specified comes from this:
  data T k (a:k) b = MkT (a b)
Here k is Required in T's kind, but we don't have Required binders in
the TyCoBinders for a term (see Note [No Required TyCoBinder in terms]
in GHC.Core.TyCo.Rep), so we change it to Specified when making MkT's TyCoBinders
-}</span><span>
</span><span id="line-601"></span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span class="hs-comment">{- Note [The binders/kind/arity fields of a TyCon]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All TyCons have this group of fields
  tyConBinders   :: [TyConBinder/TyConTyCoBinder]
  tyConResKind   :: Kind
  tyConTyVars    :: [TyVar]   -- Cached = binderVars tyConBinders
                              --   NB: Currently (Aug 2018), TyCons that own this
                              --   field really only contain TyVars. So it is
                              --   [TyVar] instead of [TyCoVar].
  tyConKind      :: Kind      -- Cached = mkTyConKind tyConBinders tyConResKind
  tyConArity     :: Arity     -- Cached = length tyConBinders

They fit together like so:

* tyConBinders gives the telescope of type/coercion variables on the LHS of the
  type declaration.  For example:

    type App a (b :: k) = a b

  tyConBinders = [ Bndr (k::*)   (NamedTCB Inferred)
                 , Bndr (a:k-&gt;*) AnonTCB
                 , Bndr (b:k)    AnonTCB ]

  Note that there are three binders here, including the
  kind variable k.

* See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep
  for what the visibility flag means.

* Each TyConBinder tyConBinders has a TyVar (sometimes it is TyCoVar), and
  that TyVar may scope over some other part of the TyCon's definition. Eg
      type T a = a -&gt; a
  we have
      tyConBinders = [ Bndr (a:*) AnonTCB ]
      synTcRhs     = a -&gt; a
  So the 'a' scopes over the synTcRhs

* From the tyConBinders and tyConResKind we can get the tyConKind
  E.g for our App example:
      App :: forall k. (k-&gt;*) -&gt; k -&gt; *

  We get a 'forall' in the kind for each NamedTCB, and an arrow
  for each AnonTCB

  tyConKind is the full kind of the TyCon, not just the result kind

* For type families, tyConArity is the arguments this TyCon must be
  applied to, to be considered saturated.  Here we mean &quot;applied to in
  the actual Type&quot;, not surface syntax; i.e. including implicit kind
  variables.  So it's just (length tyConBinders)

* For an algebraic data type, or data instance, the tyConResKind is
  always (TYPE r); that is, the tyConBinders are enough to saturate
  the type constructor.  I'm not quite sure why we have this invariant,
  but it's enforced by etaExpandAlgTyCon
-}</span><span>
</span><span id="line-659"></span><span>
</span><span id="line-660"></span><span id="local-6989586621680816087"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815559"><span class="annot"><a href="GHC.Utils.Outputable.html#OutputableBndr"><span class="hs-identifier hs-type">OutputableBndr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680816087"><span class="hs-identifier hs-type">tv</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#VarBndr"><span class="hs-identifier hs-type">VarBndr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680816087"><span class="hs-identifier hs-type">tv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-661"></span><span>  </span><span id="local-6989586621680815557"><span class="annot"><span class="annottext">ppr :: VarBndr tv TyConBndrVis -&gt; SDoc
</span><a href="#local-6989586621680815557"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680815556"><span class="annot"><span class="annottext">tv
</span><a href="#local-6989586621680815556"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621680815555"><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815555"><span class="hs-identifier hs-var">bi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; SDoc
</span><a href="#local-6989586621680815554"><span class="hs-identifier hs-var">ppr_bi</span></a></span><span> </span><span class="annot"><span class="annottext">TyConBndrVis
</span><a href="#local-6989586621680815555"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BindingSite -&gt; tv -&gt; SDoc
forall a. OutputableBndr a =&gt; BindingSite -&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprBndr"><span class="hs-identifier hs-var">pprBndr</span></a></span><span> </span><span class="annot"><span class="annottext">BindingSite
</span><a href="GHC.Utils.Outputable.html#LetBind"><span class="hs-identifier hs-var">LetBind</span></a></span><span> </span><span class="annot"><span class="annottext">tv
</span><a href="#local-6989586621680815556"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-662"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-663"></span><span>      </span><span id="local-6989586621680815554"><span class="annot"><span class="annottext">ppr_bi :: TyConBndrVis -&gt; SDoc
</span><a href="#local-6989586621680815554"><span class="hs-identifier hs-var hs-var">ppr_bi</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#VisArg"><span class="hs-identifier hs-var">VisArg</span></a></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;anon-vis&quot;</span></span><span>
</span><span id="line-664"></span><span>      </span><span class="annot"><a href="#local-6989586621680815554"><span class="hs-identifier hs-var">ppr_bi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="GHC.Types.Var.html#InvisArg"><span class="hs-identifier hs-var">InvisArg</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;anon-invis&quot;</span></span><span>
</span><span id="line-665"></span><span>      </span><span class="annot"><a href="#local-6989586621680815554"><span class="hs-identifier hs-var">ppr_bi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="GHC.Types.Var.html#Required"><span class="hs-identifier hs-var">Required</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;req&quot;</span></span><span>
</span><span id="line-666"></span><span>      </span><span class="hs-comment">-- See Note [Explicit Case Statement for Specificity]</span><span>
</span><span id="line-667"></span><span>      </span><span class="annot"><a href="#local-6989586621680815554"><span class="hs-identifier hs-var">ppr_bi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Invisible"><span class="hs-identifier hs-type">Invisible</span></a></span><span> </span><span id="local-6989586621680815549"><span class="annot"><span class="annottext">Specificity
</span><a href="#local-6989586621680815549"><span class="hs-identifier hs-var">spec</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="#local-6989586621680815549"><span class="hs-identifier hs-var">spec</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-668"></span><span>        </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#SpecifiedSpec"><span class="hs-identifier hs-var">SpecifiedSpec</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;spec&quot;</span></span><span>
</span><span id="line-669"></span><span>        </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;inf&quot;</span></span></span><span>
</span><span id="line-670"></span><span>
</span><span id="line-671"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815546"><span class="annot"><a href="GHC.Utils.Binary.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBndrVis"><span class="hs-identifier hs-type">TyConBndrVis</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-672"></span><span>  </span><span id="local-6989586621680815533"><span class="annot"><span class="annottext">put_ :: BinHandle -&gt; TyConBndrVis -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var hs-var hs-var hs-var">put_</span></a></span></span><span> </span><span id="local-6989586621680815531"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815531"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-type">AnonTCB</span></a></span><span> </span><span id="local-6989586621680815530"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815530"><span class="hs-identifier hs-var">af</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815531"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; AnonArgFlag -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815531"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815530"><span class="hs-identifier hs-var">af</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-673"></span><span>  </span><span class="annot"><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span id="local-6989586621680815528"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815528"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-type">NamedTCB</span></a></span><span> </span><span id="local-6989586621680815527"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815527"><span class="hs-identifier hs-var">vis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815528"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; ArgFlag -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815528"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815527"><span class="hs-identifier hs-var">vis</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span>  </span><span id="local-6989586621680815516"><span class="annot"><span class="annottext">get :: BinHandle -&gt; IO TyConBndrVis
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span id="local-6989586621680815514"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815514"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680815513"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621680815513"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word8
</span><a href="GHC.Utils.Binary.html#getByte"><span class="hs-identifier hs-var">getByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815514"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-676"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621680815513"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-677"></span><span>                  </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680815511"><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815511"><span class="hs-identifier hs-var">af</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO AnonArgFlag
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815514"><span class="hs-identifier hs-var">bh</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; IO TyConBndrVis
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnonArgFlag -&gt; TyConBndrVis
</span><a href="GHC.Core.TyCon.html#AnonTCB"><span class="hs-identifier hs-var">AnonTCB</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><a href="#local-6989586621680815511"><span class="hs-identifier hs-var">af</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-678"></span><span>                  </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680815510"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815510"><span class="hs-identifier hs-var">vis</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO ArgFlag
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680815514"><span class="hs-identifier hs-var">bh</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TyConBndrVis -&gt; IO TyConBndrVis
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArgFlag -&gt; TyConBndrVis
</span><a href="GHC.Core.TyCon.html#NamedTCB"><span class="hs-identifier hs-var">NamedTCB</span></a></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621680815510"><span class="hs-identifier hs-var">vis</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-679"></span><span>
</span><span id="line-680"></span><span>
</span><span id="line-681"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
               The TyCon type
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-687"></span><span>
</span><span id="line-688"></span><span>
</span><span id="line-689"></span><span class="hs-comment">-- | TyCons represent type constructors. Type constructors are introduced by</span><span>
</span><span id="line-690"></span><span class="hs-comment">-- things such as:</span><span>
</span><span id="line-691"></span><span class="hs-comment">--</span><span>
</span><span id="line-692"></span><span class="hs-comment">-- 1) Data declarations: @data Foo = ...@ creates the @Foo@ type constructor of</span><span>
</span><span id="line-693"></span><span class="hs-comment">--    kind @*@</span><span>
</span><span id="line-694"></span><span class="hs-comment">--</span><span>
</span><span id="line-695"></span><span class="hs-comment">-- 2) Type synonyms: @type Foo = ...@ creates the @Foo@ type constructor</span><span>
</span><span id="line-696"></span><span class="hs-comment">--</span><span>
</span><span id="line-697"></span><span class="hs-comment">-- 3) Newtypes: @newtype Foo a = MkFoo ...@ creates the @Foo@ type constructor</span><span>
</span><span id="line-698"></span><span class="hs-comment">--    of kind @* -&gt; *@</span><span>
</span><span id="line-699"></span><span class="hs-comment">--</span><span>
</span><span id="line-700"></span><span class="hs-comment">-- 4) Class declarations: @class Foo where@ creates the @Foo@ type constructor</span><span>
</span><span id="line-701"></span><span class="hs-comment">--    of kind @*@</span><span>
</span><span id="line-702"></span><span class="hs-comment">--</span><span>
</span><span id="line-703"></span><span class="hs-comment">-- This data type also encodes a number of primitive, built in type constructors</span><span>
</span><span id="line-704"></span><span class="hs-comment">-- such as those for function and tuple types.</span><span>
</span><span id="line-705"></span><span>
</span><span id="line-706"></span><span class="hs-comment">-- If you edit this type, you may need to update the GHC formalism</span><span>
</span><span id="line-707"></span><span class="hs-comment">-- See Note [GHC Formalism] in GHC.Core.Lint</span><span>
</span><span id="line-708"></span><span class="hs-keyword">data</span><span> </span><span id="TyCon"><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-var">TyCon</span></a></span></span><span>
</span><span id="line-709"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- | The function type constructor, @(-&gt;)@</span><span>
</span><span id="line-710"></span><span>    </span><span id="FunTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-var">FunTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-711"></span><span>        </span><span id="tyConUnique"><span class="annot"><span class="annottext">TyCon -&gt; Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var hs-var">tyConUnique</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ^ A Unique of this TyCon. Invariant:</span><span>
</span><span id="line-712"></span><span>                                 </span><span class="hs-comment">-- identical to Unique of Name stored in</span><span>
</span><span id="line-713"></span><span>                                 </span><span class="hs-comment">-- tyConName field.</span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span>        </span><span id="tyConName"><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>     </span><span class="hs-comment">-- ^ Name of the constructor</span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-718"></span><span>        </span><span id="tyConBinders"><span class="annot"><span class="annottext">TyCon -&gt; [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-719"></span><span>        </span><span id="tyConResKind"><span class="annot"><span class="annottext">TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-720"></span><span>        </span><span id="tyConKind"><span class="annot"><span class="annottext">TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-721"></span><span>        </span><span id="tyConArity"><span class="annot"><span class="annottext">TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-722"></span><span>
</span><span id="line-723"></span><span>        </span><span id="tcRepName"><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var hs-var">tcRepName</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-724"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-725"></span><span>
</span><span id="line-726"></span><span>  </span><span class="hs-comment">-- | Algebraic data types, from</span><span>
</span><span id="line-727"></span><span>  </span><span class="hs-comment">--     - @data@ declarations</span><span>
</span><span id="line-728"></span><span>  </span><span class="hs-comment">--     - @newtype@ declarations</span><span>
</span><span id="line-729"></span><span>  </span><span class="hs-comment">--     - data instance declarations</span><span>
</span><span id="line-730"></span><span>  </span><span class="hs-comment">--     - type instance declarations</span><span>
</span><span id="line-731"></span><span>  </span><span class="hs-comment">--     - the TyCon generated by a class declaration</span><span>
</span><span id="line-732"></span><span>  </span><span class="hs-comment">--     - boxed tuples</span><span>
</span><span id="line-733"></span><span>  </span><span class="hs-comment">--     - unboxed tuples</span><span>
</span><span id="line-734"></span><span>  </span><span class="hs-comment">--     - constraint tuples</span><span>
</span><span id="line-735"></span><span>  </span><span class="hs-comment">-- All these constructors are lifted and boxed except unboxed tuples</span><span>
</span><span id="line-736"></span><span>  </span><span class="hs-comment">-- which should have an 'UnboxedAlgTyCon' parent.</span><span>
</span><span id="line-737"></span><span>  </span><span class="hs-comment">-- Data/newtype/type /families/ are handled by 'FamilyTyCon'.</span><span>
</span><span id="line-738"></span><span>  </span><span class="hs-comment">-- See 'AlgTyConRhs' for more information.</span><span>
</span><span id="line-739"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="AlgTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-var">AlgTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-740"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ A Unique of this TyCon. Invariant:</span><span>
</span><span id="line-741"></span><span>                                 </span><span class="hs-comment">-- identical to Unique of Name stored in</span><span>
</span><span id="line-742"></span><span>                                 </span><span class="hs-comment">-- tyConName field.</span><span>
</span><span id="line-743"></span><span>
</span><span id="line-744"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Name of the constructor</span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-747"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-748"></span><span>        </span><span id="tyConTyVars"><span class="annot"><span class="annottext">TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- ^ TyVar binders</span><span>
</span><span id="line-749"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-750"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-751"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-752"></span><span>
</span><span id="line-753"></span><span>              </span><span class="hs-comment">-- The tyConTyVars scope over:</span><span>
</span><span id="line-754"></span><span>              </span><span class="hs-comment">--</span><span>
</span><span id="line-755"></span><span>              </span><span class="hs-comment">-- 1. The 'algTcStupidTheta'</span><span>
</span><span id="line-756"></span><span>              </span><span class="hs-comment">-- 2. The cached types in algTyConRhs.NewTyCon</span><span>
</span><span id="line-757"></span><span>              </span><span class="hs-comment">-- 3. The family instance types if present</span><span>
</span><span id="line-758"></span><span>              </span><span class="hs-comment">--</span><span>
</span><span id="line-759"></span><span>              </span><span class="hs-comment">-- Note that it does /not/ scope over the data</span><span>
</span><span id="line-760"></span><span>              </span><span class="hs-comment">-- constructors.</span><span>
</span><span id="line-761"></span><span>
</span><span id="line-762"></span><span>        </span><span id="tcRoles"><span class="annot"><span class="annottext">TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var hs-var">tcRoles</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ The role for each type variable</span><span>
</span><span id="line-763"></span><span>                                 </span><span class="hs-comment">-- This list has length = tyConArity</span><span>
</span><span id="line-764"></span><span>                                 </span><span class="hs-comment">-- See also Note [TyCon Role signatures]</span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span>        </span><span id="tyConCType"><span class="annot"><span class="annottext">TyCon -&gt; Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier hs-var hs-var">tyConCType</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html#CType"><span class="hs-identifier hs-type">CType</span></a></span><span class="hs-special">,</span><span class="hs-comment">-- ^ The C type that should be used</span><span>
</span><span id="line-767"></span><span>                                    </span><span class="hs-comment">-- for this type when using the FFI</span><span>
</span><span id="line-768"></span><span>                                    </span><span class="hs-comment">-- and CAPI</span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span>        </span><span id="algTcGadtSyntax"><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#algTcGadtSyntax"><span class="hs-identifier hs-var hs-var">algTcGadtSyntax</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ^ Was the data type declared with GADT</span><span>
</span><span id="line-771"></span><span>                                    </span><span class="hs-comment">-- syntax?  If so, that doesn't mean it's a</span><span>
</span><span id="line-772"></span><span>                                    </span><span class="hs-comment">-- true GADT; only that the &quot;where&quot; form</span><span>
</span><span id="line-773"></span><span>                                    </span><span class="hs-comment">-- was used.  This field is used only to</span><span>
</span><span id="line-774"></span><span>                                    </span><span class="hs-comment">-- guide pretty-printing</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>        </span><span id="algTcStupidTheta"><span class="annot"><span class="annottext">TyCon -&gt; [Kind]
</span><a href="GHC.Core.TyCon.html#algTcStupidTheta"><span class="hs-identifier hs-var hs-var">algTcStupidTheta</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ The \&quot;stupid theta\&quot; for the data</span><span>
</span><span id="line-777"></span><span>                                        </span><span class="hs-comment">-- type (always empty for GADTs).  A</span><span>
</span><span id="line-778"></span><span>                                        </span><span class="hs-comment">-- \&quot;stupid theta\&quot; is the context to</span><span>
</span><span id="line-779"></span><span>                                        </span><span class="hs-comment">-- the left of an algebraic type</span><span>
</span><span id="line-780"></span><span>                                        </span><span class="hs-comment">-- declaration, e.g. @Eq a@ in the</span><span>
</span><span id="line-781"></span><span>                                        </span><span class="hs-comment">-- declaration @data Eq a =&gt; T a ...@.</span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span>        </span><span id="algTcRhs"><span class="annot"><span class="annottext">TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var hs-var">algTcRhs</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Contains information about the</span><span>
</span><span id="line-784"></span><span>                                    </span><span class="hs-comment">-- data constructors of the algebraic type</span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span>        </span><span id="algTcFields"><span class="annot"><span class="annottext">TyCon -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier hs-var hs-var">algTcFields</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelEnv"><span class="hs-identifier hs-type">FieldLabelEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Maps a label to information</span><span>
</span><span id="line-787"></span><span>                                      </span><span class="hs-comment">-- about the field</span><span>
</span><span id="line-788"></span><span>
</span><span id="line-789"></span><span>        </span><span id="algTcParent"><span class="annot"><span class="annottext">TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var hs-var">algTcParent</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span> </span><span class="hs-comment">-- ^ Gives the class or family declaration</span><span>
</span><span id="line-790"></span><span>                                       </span><span class="hs-comment">-- 'TyCon' for derived 'TyCon's representing</span><span>
</span><span id="line-791"></span><span>                                       </span><span class="hs-comment">-- class or family instances, respectively.</span><span>
</span><span id="line-792"></span><span>
</span><span id="line-793"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-794"></span><span>
</span><span id="line-795"></span><span>  </span><span class="hs-comment">-- | Represents type synonyms</span><span>
</span><span id="line-796"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SynonymTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-var">SynonymTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-797"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ A Unique of this TyCon. Invariant:</span><span>
</span><span id="line-798"></span><span>                                 </span><span class="hs-comment">-- identical to Unique of Name stored in</span><span>
</span><span id="line-799"></span><span>                                 </span><span class="hs-comment">-- tyConName field.</span><span>
</span><span id="line-800"></span><span>
</span><span id="line-801"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Name of the constructor</span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-804"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-805"></span><span>        </span><span id="tyConTyVars"><span class="annot"><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- ^ TyVar binders</span><span>
</span><span id="line-806"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-807"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-808"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-809"></span><span>             </span><span class="hs-comment">-- tyConTyVars scope over: synTcRhs</span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span>        </span><span id="tcRoles"><span class="annot"><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ The role for each type variable</span><span>
</span><span id="line-812"></span><span>                                 </span><span class="hs-comment">-- This list has length = tyConArity</span><span>
</span><span id="line-813"></span><span>                                 </span><span class="hs-comment">-- See also Note [TyCon Role signatures]</span><span>
</span><span id="line-814"></span><span>
</span><span id="line-815"></span><span>        </span><span id="synTcRhs"><span class="annot"><span class="annottext">TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#synTcRhs"><span class="hs-identifier hs-var hs-var">synTcRhs</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Contains information about the expansion</span><span>
</span><span id="line-816"></span><span>                                 </span><span class="hs-comment">-- of the synonym</span><span>
</span><span id="line-817"></span><span>
</span><span id="line-818"></span><span>        </span><span id="synIsTau"><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#synIsTau"><span class="hs-identifier hs-var hs-var">synIsTau</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- True &lt;=&gt; the RHS of this synonym does not</span><span>
</span><span id="line-819"></span><span>                                 </span><span class="hs-comment">--          have any foralls, after expanding any</span><span>
</span><span id="line-820"></span><span>                                 </span><span class="hs-comment">--          nested synonyms</span><span>
</span><span id="line-821"></span><span>        </span><span id="synIsFamFree"><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#synIsFamFree"><span class="hs-identifier hs-var hs-var">synIsFamFree</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>    </span><span class="hs-comment">-- True &lt;=&gt; the RHS of this synonym does not mention</span><span>
</span><span id="line-822"></span><span>                                 </span><span class="hs-comment">--          any type synonym families (data families</span><span>
</span><span id="line-823"></span><span>                                 </span><span class="hs-comment">--          are fine), again after expanding any</span><span>
</span><span id="line-824"></span><span>                                 </span><span class="hs-comment">--          nested synonyms</span><span>
</span><span id="line-825"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-826"></span><span>
</span><span id="line-827"></span><span>  </span><span class="hs-comment">-- | Represents families (both type and data)</span><span>
</span><span id="line-828"></span><span>  </span><span class="hs-comment">-- Argument roles are all Nominal</span><span>
</span><span id="line-829"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FamilyTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-var">FamilyTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-830"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ A Unique of this TyCon. Invariant:</span><span>
</span><span id="line-831"></span><span>                                 </span><span class="hs-comment">-- identical to Unique of Name stored in</span><span>
</span><span id="line-832"></span><span>                                 </span><span class="hs-comment">-- tyConName field.</span><span>
</span><span id="line-833"></span><span>
</span><span id="line-834"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Name of the constructor</span><span>
</span><span id="line-835"></span><span>
</span><span id="line-836"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-837"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-838"></span><span>        </span><span id="tyConTyVars"><span class="annot"><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- ^ TyVar binders</span><span>
</span><span id="line-839"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-840"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-841"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-842"></span><span>            </span><span class="hs-comment">-- tyConTyVars connect an associated family TyCon</span><span>
</span><span id="line-843"></span><span>            </span><span class="hs-comment">-- with its parent class; see GHC.Tc.Validity.checkConsistentFamInst</span><span>
</span><span id="line-844"></span><span>
</span><span id="line-845"></span><span>        </span><span id="famTcResVar"><span class="annot"><span class="annottext">TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#famTcResVar"><span class="hs-identifier hs-var hs-var">famTcResVar</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ^ Name of result type variable, used</span><span>
</span><span id="line-846"></span><span>                                      </span><span class="hs-comment">-- for pretty-printing with --show-iface</span><span>
</span><span id="line-847"></span><span>                                      </span><span class="hs-comment">-- and for reifying TyCon in Template</span><span>
</span><span id="line-848"></span><span>                                      </span><span class="hs-comment">-- Haskell</span><span>
</span><span id="line-849"></span><span>
</span><span id="line-850"></span><span>        </span><span id="famTcFlav"><span class="annot"><span class="annottext">TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var hs-var">famTcFlav</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-type">FamTyConFlav</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Type family flavour: open, closed,</span><span>
</span><span id="line-851"></span><span>                                      </span><span class="hs-comment">-- abstract, built-in. See comments for</span><span>
</span><span id="line-852"></span><span>                                      </span><span class="hs-comment">-- FamTyConFlav</span><span>
</span><span id="line-853"></span><span>
</span><span id="line-854"></span><span>        </span><span id="famTcParent"><span class="annot"><span class="annottext">TyCon -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#famTcParent"><span class="hs-identifier hs-var hs-var">famTcParent</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- ^ For *associated* type/data families</span><span>
</span><span id="line-855"></span><span>                                      </span><span class="hs-comment">-- The class tycon in which the family is declared</span><span>
</span><span id="line-856"></span><span>                                      </span><span class="hs-comment">-- See Note [Associated families and their parent class]</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span>        </span><span id="famTcInj"><span class="annot"><span class="annottext">TyCon -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#famTcInj"><span class="hs-identifier hs-var hs-var">famTcInj</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier hs-type">Injectivity</span></a></span><span>   </span><span class="hs-comment">-- ^ is this a type family injective in</span><span>
</span><span id="line-859"></span><span>                                      </span><span class="hs-comment">-- its type variables? Nothing if no</span><span>
</span><span id="line-860"></span><span>                                      </span><span class="hs-comment">-- injectivity annotation was given</span><span>
</span><span id="line-861"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span>  </span><span class="hs-comment">-- | Primitive types; cannot be defined in Haskell. This includes</span><span>
</span><span id="line-864"></span><span>  </span><span class="hs-comment">-- the usual suspects (such as @Int#@) as well as foreign-imported</span><span>
</span><span id="line-865"></span><span>  </span><span class="hs-comment">-- types and kinds (@*@, @#@, and @?@)</span><span>
</span><span id="line-866"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PrimTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-var">PrimTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-867"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ A Unique of this TyCon. Invariant:</span><span>
</span><span id="line-868"></span><span>                                 </span><span class="hs-comment">-- identical to Unique of Name stored in</span><span>
</span><span id="line-869"></span><span>                                 </span><span class="hs-comment">-- tyConName field.</span><span>
</span><span id="line-870"></span><span>
</span><span id="line-871"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ^ Name of the constructor</span><span>
</span><span id="line-872"></span><span>
</span><span id="line-873"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-874"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-875"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-876"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-877"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-878"></span><span>
</span><span id="line-879"></span><span>        </span><span id="tcRoles"><span class="annot"><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ The role for each type variable</span><span>
</span><span id="line-880"></span><span>                                 </span><span class="hs-comment">-- This list has length = tyConArity</span><span>
</span><span id="line-881"></span><span>                                 </span><span class="hs-comment">-- See also Note [TyCon Role signatures]</span><span>
</span><span id="line-882"></span><span>
</span><span id="line-883"></span><span>        </span><span id="isUnlifted"><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnlifted"><span class="hs-identifier hs-var hs-var">isUnlifted</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Most primitive tycons are unlifted (may</span><span>
</span><span id="line-884"></span><span>                                 </span><span class="hs-comment">-- not contain bottom) but other are lifted,</span><span>
</span><span id="line-885"></span><span>                                 </span><span class="hs-comment">-- e.g. @RealWorld@</span><span>
</span><span id="line-886"></span><span>                                 </span><span class="hs-comment">-- Only relevant if tyConKind = *</span><span>
</span><span id="line-887"></span><span>
</span><span id="line-888"></span><span>        </span><span id="primRepName"><span class="annot"><span class="annottext">TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#primRepName"><span class="hs-identifier hs-var hs-var">primRepName</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>   </span><span class="hs-comment">-- Only relevant for kind TyCons</span><span>
</span><span id="line-889"></span><span>                                            </span><span class="hs-comment">-- i.e, *, #, ?</span><span>
</span><span id="line-890"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>  </span><span class="hs-comment">-- | Represents promoted data constructor.</span><span>
</span><span id="line-893"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PromotedDataCon"><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-var">PromotedDataCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>          </span><span class="hs-comment">-- See Note [Promoted data constructors]</span><span>
</span><span id="line-894"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>     </span><span class="hs-comment">-- ^ Same Unique as the data constructor</span><span>
</span><span id="line-895"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- ^ Same Name as the data constructor</span><span>
</span><span id="line-896"></span><span>
</span><span id="line-897"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-898"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConTyCoBinder"><span class="hs-identifier hs-type">TyConTyCoBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-899"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-900"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>             </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-901"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-902"></span><span>
</span><span id="line-903"></span><span>        </span><span id="tcRoles"><span class="annot"><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ Roles: N for kind vars, R for type vars</span><span>
</span><span id="line-904"></span><span>        </span><span id="dataCon"><span class="annot"><span class="annottext">TyCon -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#dataCon"><span class="hs-identifier hs-var hs-var">dataCon</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">,</span><span>   </span><span class="hs-comment">-- ^ Corresponding data constructor</span><span>
</span><span id="line-905"></span><span>        </span><span id="tcRepName"><span class="annot"><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var">tcRepName</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-906"></span><span>        </span><span id="promDcRepInfo"><span class="annot"><span class="annottext">TyCon -&gt; RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#promDcRepInfo"><span class="hs-identifier hs-var hs-var">promDcRepInfo</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRepInfo"><span class="hs-identifier hs-type">RuntimeRepInfo</span></a></span><span>  </span><span class="hs-comment">-- ^ See comments with 'RuntimeRepInfo'</span><span>
</span><span id="line-907"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-908"></span><span>
</span><span id="line-909"></span><span>  </span><span class="hs-comment">-- | These exist only during type-checking. See Note [How TcTyCons work]</span><span>
</span><span id="line-910"></span><span>  </span><span class="hs-comment">-- in &quot;GHC.Tc.TyCl&quot;</span><span>
</span><span id="line-911"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TcTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-var">TcTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-912"></span><span>        </span><span id="tyConUnique"><span class="annot"><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-913"></span><span>        </span><span id="tyConName"><span class="annot"><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-914"></span><span>
</span><span id="line-915"></span><span>        </span><span class="hs-comment">-- See Note [The binders/kind/arity fields of a TyCon]</span><span>
</span><span id="line-916"></span><span>        </span><span id="tyConBinders"><span class="annot"><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Full binders</span><span>
</span><span id="line-917"></span><span>        </span><span id="tyConTyVars"><span class="annot"><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- ^ TyVar binders</span><span>
</span><span id="line-918"></span><span>        </span><span id="tyConResKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-919"></span><span>        </span><span id="tyConKind"><span class="annot"><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- ^ Kind of this TyCon</span><span>
</span><span id="line-920"></span><span>        </span><span id="tyConArity"><span class="annot"><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- ^ Arity</span><span>
</span><span id="line-921"></span><span>
</span><span id="line-922"></span><span>          </span><span class="hs-comment">-- NB: the TyConArity of a TcTyCon must match</span><span>
</span><span id="line-923"></span><span>          </span><span class="hs-comment">-- the number of Required (positional, user-specified)</span><span>
</span><span id="line-924"></span><span>          </span><span class="hs-comment">-- arguments to the type constructor; see the use</span><span>
</span><span id="line-925"></span><span>          </span><span class="hs-comment">-- of tyConArity in generaliseTcTyCon</span><span>
</span><span id="line-926"></span><span>
</span><span id="line-927"></span><span>        </span><span id="tcTyConScopedTyVars"><span class="annot"><span class="annottext">TyCon -&gt; [(Name, TyVar)]
</span><a href="GHC.Core.TyCon.html#tcTyConScopedTyVars"><span class="hs-identifier hs-var hs-var">tcTyConScopedTyVars</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-928"></span><span>          </span><span class="hs-comment">-- ^ Scoped tyvars over the tycon's body</span><span>
</span><span id="line-929"></span><span>          </span><span class="hs-comment">-- See Note [Scoped tyvars in a TcTyCon]</span><span>
</span><span id="line-930"></span><span>
</span><span id="line-931"></span><span>        </span><span id="tcTyConIsPoly"><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#tcTyConIsPoly"><span class="hs-identifier hs-var hs-var">tcTyConIsPoly</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- ^ Is this TcTyCon already generalized?</span><span>
</span><span id="line-932"></span><span>
</span><span id="line-933"></span><span>        </span><span id="tcTyConFlavour"><span class="annot"><span class="annottext">TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#tcTyConFlavour"><span class="hs-identifier hs-var hs-var">tcTyConFlavour</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span>
</span><span id="line-934"></span><span>                           </span><span class="hs-comment">-- ^ What sort of 'TyCon' this represents.</span><span>
</span><span id="line-935"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-936"></span><span class="hs-comment">{- Note [Scoped tyvars in a TcTyCon]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The tcTyConScopedTyVars field records the lexicial-binding connection
between the original, user-specified Name (i.e. thing in scope) and
the TcTyVar that the Name is bound to.

Order *does* matter; the tcTyConScopedTyvars list consists of
     specified_tvs ++ required_tvs

where
   * specified ones first
   * required_tvs the same as tyConTyVars
   * tyConArity = length required_tvs

See also Note [How TcTyCons work] in GHC.Tc.TyCl
-}</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span class="hs-comment">-- | Represents right-hand-sides of 'TyCon's for algebraic types</span><span>
</span><span id="line-955"></span><span class="hs-keyword">data</span><span> </span><span id="AlgTyConRhs"><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-var">AlgTyConRhs</span></a></span></span><span>
</span><span id="line-956"></span><span>
</span><span id="line-957"></span><span>    </span><span class="hs-comment">-- | Says that we know nothing about this data type, except that</span><span>
</span><span id="line-958"></span><span>    </span><span class="hs-comment">-- it's represented by a pointer.  Used when we export a data type</span><span>
</span><span id="line-959"></span><span>    </span><span class="hs-comment">-- abstractly into an .hi file.</span><span>
</span><span id="line-960"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="AbstractTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-var">AbstractTyCon</span></a></span></span><span>
</span><span id="line-961"></span><span>
</span><span id="line-962"></span><span>    </span><span class="hs-comment">-- | Information about those 'TyCon's derived from a @data@</span><span>
</span><span id="line-963"></span><span>    </span><span class="hs-comment">-- declaration. This includes data types with no constructors at</span><span>
</span><span id="line-964"></span><span>    </span><span class="hs-comment">-- all.</span><span>
</span><span id="line-965"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DataTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-var">DataTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-966"></span><span>        </span><span id="data_cons"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var hs-var">data_cons</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-967"></span><span>                          </span><span class="hs-comment">-- ^ The data type constructors; can be empty if the</span><span>
</span><span id="line-968"></span><span>                          </span><span class="hs-comment">--   user declares the type to have no constructors</span><span>
</span><span id="line-969"></span><span>                          </span><span class="hs-comment">--</span><span>
</span><span id="line-970"></span><span>                          </span><span class="hs-comment">-- INVARIANT: Kept in order of increasing 'DataCon'</span><span>
</span><span id="line-971"></span><span>                          </span><span class="hs-comment">-- tag (see the tag assignment in mkTyConTagMap)</span><span>
</span><span id="line-972"></span><span>        </span><span id="data_cons_size"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; Int
</span><a href="GHC.Core.TyCon.html#data_cons_size"><span class="hs-identifier hs-var hs-var">data_cons_size</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span>
</span><span id="line-973"></span><span>                          </span><span class="hs-comment">-- ^ Cached value: length data_cons</span><span>
</span><span id="line-974"></span><span>        </span><span id="is_enum"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#is_enum"><span class="hs-identifier hs-var hs-var">is_enum</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>   </span><span class="hs-comment">-- ^ Cached value: is this an enumeration type?</span><span>
</span><span id="line-975"></span><span>                          </span><span class="hs-comment">--   See Note [Enumeration types]</span><span>
</span><span id="line-976"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-977"></span><span>
</span><span id="line-978"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TupleTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-var">TupleTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>                   </span><span class="hs-comment">-- A boxed, unboxed, or constraint tuple</span><span>
</span><span id="line-979"></span><span>        </span><span id="data_con"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var hs-var">data_con</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- NB: it can be an *unboxed* tuple</span><span>
</span><span id="line-980"></span><span>        </span><span id="tup_sort"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var hs-var">tup_sort</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TupleSort"><span class="hs-identifier hs-type">TupleSort</span></a></span><span>      </span><span class="hs-comment">-- ^ Is this a boxed, unboxed or constraint</span><span>
</span><span id="line-981"></span><span>                                   </span><span class="hs-comment">-- tuple?</span><span>
</span><span id="line-982"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-983"></span><span>
</span><span id="line-984"></span><span>  </span><span class="hs-comment">-- | An unboxed sum type.</span><span>
</span><span id="line-985"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SumTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-var">SumTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-986"></span><span>        </span><span id="data_cons"><span class="annot"><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-987"></span><span>        </span><span id="data_cons_size"><span class="annot"><a href="GHC.Core.TyCon.html#data_cons_size"><span class="hs-identifier hs-var">data_cons_size</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- ^ Cached value: length data_cons</span><span>
</span><span id="line-988"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-989"></span><span>
</span><span id="line-990"></span><span>  </span><span class="hs-comment">-- | Information about those 'TyCon's derived from a @newtype@ declaration</span><span>
</span><span id="line-991"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NewTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-var">NewTyCon</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-992"></span><span>        </span><span id="data_con"><span class="annot"><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- ^ The unique constructor for the @newtype@.</span><span>
</span><span id="line-993"></span><span>                                </span><span class="hs-comment">--   It has no existentials</span><span>
</span><span id="line-994"></span><span>
</span><span id="line-995"></span><span>        </span><span id="nt_rhs"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; Kind
</span><a href="GHC.Core.TyCon.html#nt_rhs"><span class="hs-identifier hs-var hs-var">nt_rhs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- ^ Cached value: the argument type of the</span><span>
</span><span id="line-996"></span><span>                                </span><span class="hs-comment">-- constructor, which is just the representation</span><span>
</span><span id="line-997"></span><span>                                </span><span class="hs-comment">-- type of the 'TyCon' (remember that @newtype@s</span><span>
</span><span id="line-998"></span><span>                                </span><span class="hs-comment">-- do not exist at runtime so need a different</span><span>
</span><span id="line-999"></span><span>                                </span><span class="hs-comment">-- representation type).</span><span>
</span><span id="line-1000"></span><span>                                </span><span class="hs-comment">--</span><span>
</span><span id="line-1001"></span><span>                                </span><span class="hs-comment">-- The free 'TyVar's of this type are the</span><span>
</span><span id="line-1002"></span><span>                                </span><span class="hs-comment">-- 'tyConTyVars' from the corresponding 'TyCon'</span><span>
</span><span id="line-1003"></span><span>
</span><span id="line-1004"></span><span>        </span><span id="nt_etad_rhs"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#nt_etad_rhs"><span class="hs-identifier hs-var hs-var">nt_etad_rhs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-1005"></span><span>                        </span><span class="hs-comment">-- ^ Same as the 'nt_rhs', but this time eta-reduced.</span><span>
</span><span id="line-1006"></span><span>                        </span><span class="hs-comment">-- Hence the list of 'TyVar's in this field may be</span><span>
</span><span id="line-1007"></span><span>                        </span><span class="hs-comment">-- shorter than the declared arity of the 'TyCon'.</span><span>
</span><span id="line-1008"></span><span>
</span><span id="line-1009"></span><span>                        </span><span class="hs-comment">-- See Note [Newtype eta]</span><span>
</span><span id="line-1010"></span><span>        </span><span id="nt_co"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; CoAxiom Unbranched
</span><a href="GHC.Core.TyCon.html#nt_co"><span class="hs-identifier hs-var hs-var">nt_co</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1011"></span><span>                             </span><span class="hs-comment">-- The axiom coercion that creates the @newtype@</span><span>
</span><span id="line-1012"></span><span>                             </span><span class="hs-comment">-- from the representation 'Type'.</span><span>
</span><span id="line-1013"></span><span>
</span><span id="line-1014"></span><span>                             </span><span class="hs-comment">-- See Note [Newtype coercions]</span><span>
</span><span id="line-1015"></span><span>                             </span><span class="hs-comment">-- Invariant: arity = #tvs in nt_etad_rhs;</span><span>
</span><span id="line-1016"></span><span>                             </span><span class="hs-comment">-- See Note [Newtype eta]</span><span>
</span><span id="line-1017"></span><span>                             </span><span class="hs-comment">-- Watch out!  If any newtypes become transparent</span><span>
</span><span id="line-1018"></span><span>                             </span><span class="hs-comment">-- again check #1072.</span><span>
</span><span id="line-1019"></span><span>        </span><span id="nt_lev_poly"><span class="annot"><span class="annottext">AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#nt_lev_poly"><span class="hs-identifier hs-var hs-var">nt_lev_poly</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1020"></span><span>                        </span><span class="hs-comment">-- 'True' if the newtype can be levity polymorphic when</span><span>
</span><span id="line-1021"></span><span>                        </span><span class="hs-comment">-- fully applied to its arguments, 'False' otherwise.</span><span>
</span><span id="line-1022"></span><span>                        </span><span class="hs-comment">-- This can only ever be 'True' with UnliftedNewtypes.</span><span>
</span><span id="line-1023"></span><span>                        </span><span class="hs-comment">--</span><span>
</span><span id="line-1024"></span><span>                        </span><span class="hs-comment">-- Invariant: nt_lev_poly nt = isTypeLevPoly (nt_rhs nt)</span><span>
</span><span id="line-1025"></span><span>                        </span><span class="hs-comment">--</span><span>
</span><span id="line-1026"></span><span>                        </span><span class="hs-comment">-- This is cached to make it cheaper to check if a</span><span>
</span><span id="line-1027"></span><span>                        </span><span class="hs-comment">-- variable binding is levity polymorphic, as used by</span><span>
</span><span id="line-1028"></span><span>                        </span><span class="hs-comment">-- isTcLevPoly.</span><span>
</span><span id="line-1029"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1030"></span><span>
</span><span id="line-1031"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkSumTyConRhs"><span class="hs-identifier hs-type">mkSumTyConRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span>
</span><span id="line-1032"></span><span id="mkSumTyConRhs"><span class="annot"><span class="annottext">mkSumTyConRhs :: [DataCon] -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#mkSumTyConRhs"><span class="hs-identifier hs-var hs-var">mkSumTyConRhs</span></a></span></span><span> </span><span id="local-6989586621680815469"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815469"><span class="hs-identifier hs-var">data_cons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Int -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-var">SumTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815469"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[DataCon] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815469"><span class="hs-identifier hs-var">data_cons</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1033"></span><span>
</span><span id="line-1034"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkDataTyConRhs"><span class="hs-identifier hs-type">mkDataTyConRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span>
</span><span id="line-1035"></span><span id="mkDataTyConRhs"><span class="annot"><span class="annottext">mkDataTyConRhs :: [DataCon] -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#mkDataTyConRhs"><span class="hs-identifier hs-var hs-var">mkDataTyConRhs</span></a></span></span><span> </span><span id="local-6989586621680815467"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815467"><span class="hs-identifier hs-var">cons</span></a></span></span><span>
</span><span id="line-1036"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataTyCon :: [DataCon] -&gt; Int -&gt; Bool -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1037"></span><span>        </span><span class="annot"><span class="annottext">data_cons :: [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815467"><span class="hs-identifier hs-var">cons</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1038"></span><span>        </span><span class="annot"><span class="annottext">data_cons_size :: Int
</span><a href="GHC.Core.TyCon.html#data_cons_size"><span class="hs-identifier hs-var">data_cons_size</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815467"><span class="hs-identifier hs-var">cons</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1039"></span><span>        </span><span class="annot"><span class="annottext">is_enum :: Bool
</span><a href="GHC.Core.TyCon.html#is_enum"><span class="hs-identifier hs-var">is_enum</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[DataCon] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815467"><span class="hs-identifier hs-var">cons</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; Bool) -&gt; [DataCon] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="#local-6989586621680815464"><span class="hs-identifier hs-var">is_enum_con</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815467"><span class="hs-identifier hs-var">cons</span></a></span><span>
</span><span id="line-1040"></span><span>                  </span><span class="hs-comment">-- See Note [Enumeration types] in GHC.Core.TyCon</span><span>
</span><span id="line-1041"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1042"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1043"></span><span>    </span><span id="local-6989586621680815464"><span class="annot"><span class="annottext">is_enum_con :: DataCon -&gt; Bool
</span><a href="#local-6989586621680815464"><span class="hs-identifier hs-var hs-var">is_enum_con</span></a></span></span><span> </span><span id="local-6989586621680815459"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815459"><span class="hs-identifier hs-var">con</span></a></span></span><span>
</span><span id="line-1044"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680815458"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815458"><span class="hs-identifier hs-var">_univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815457"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815457"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815456"><span class="annot"><span class="annottext">[EqSpec]
</span><a href="#local-6989586621680815456"><span class="hs-identifier hs-var">eq_spec</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815455"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815455"><span class="hs-identifier hs-var">theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815454"><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621680815454"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815453"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815453"><span class="hs-identifier hs-var">_res</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1045"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DataCon
-&gt; ([TyVar], [TyVar], [EqSpec], [Kind], [Scaled Kind], Kind)
</span><a href="GHC.Core.DataCon.html#dataConFullSig"><span class="hs-identifier hs-var">dataConFullSig</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815459"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-1046"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815457"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[EqSpec] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[EqSpec]
</span><a href="#local-6989586621680815456"><span class="hs-identifier hs-var">eq_spec</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815455"><span class="hs-identifier hs-var">theta</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Scaled Kind] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621680815454"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-1047"></span><span>
</span><span id="line-1048"></span><span class="hs-comment">-- | Some promoted datacons signify extra info relevant to GHC. For example,</span><span>
</span><span id="line-1049"></span><span class="hs-comment">-- the @IntRep@ constructor of @RuntimeRep@ corresponds to the 'IntRep'</span><span>
</span><span id="line-1050"></span><span class="hs-comment">-- constructor of 'PrimRep'. This data structure allows us to store this</span><span>
</span><span id="line-1051"></span><span class="hs-comment">-- information right in the 'TyCon'. The other approach would be to look</span><span>
</span><span id="line-1052"></span><span class="hs-comment">-- up things like @RuntimeRep@'s @PrimRep@ by known-key every time.</span><span>
</span><span id="line-1053"></span><span class="hs-comment">-- See also Note [Getting from RuntimeRep to PrimRep] in &quot;GHC.Types.RepType&quot;</span><span>
</span><span id="line-1054"></span><span class="hs-keyword">data</span><span> </span><span id="RuntimeRepInfo"><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRepInfo"><span class="hs-identifier hs-var">RuntimeRepInfo</span></a></span></span><span>
</span><span id="line-1055"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="NoRRI"><span class="annot"><a href="GHC.Core.TyCon.html#NoRRI"><span class="hs-identifier hs-var">NoRRI</span></a></span></span><span>       </span><span class="hs-comment">-- ^ an ordinary promoted data con</span><span>
</span><span id="line-1056"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="RuntimeRep"><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRep"><span class="hs-identifier hs-var">RuntimeRep</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1057"></span><span>      </span><span class="hs-comment">-- ^ A constructor of @RuntimeRep@. The argument to the function should</span><span>
</span><span id="line-1058"></span><span>      </span><span class="hs-comment">-- be the list of arguments to the promoted datacon.</span><span>
</span><span id="line-1059"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="VecCount"><span class="annot"><a href="GHC.Core.TyCon.html#VecCount"><span class="hs-identifier hs-var">VecCount</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>         </span><span class="hs-comment">-- ^ A constructor of @VecCount@</span><span>
</span><span id="line-1060"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="VecElem"><span class="annot"><a href="GHC.Core.TyCon.html#VecElem"><span class="hs-identifier hs-var">VecElem</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier hs-type">PrimElemRep</span></a></span><span>  </span><span class="hs-comment">-- ^ A constructor of @VecElem@</span><span>
</span><span id="line-1061"></span><span>
</span><span id="line-1062"></span><span class="hs-comment">-- | Extract those 'DataCon's that we are able to learn about.  Note</span><span>
</span><span id="line-1063"></span><span class="hs-comment">-- that visibility in this sense does not correspond to visibility in</span><span>
</span><span id="line-1064"></span><span class="hs-comment">-- the context of any particular user program!</span><span>
</span><span id="line-1065"></span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-type">visibleDataCons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1066"></span><span id="visibleDataCons"><span class="annot"><span class="annottext">visibleDataCons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var hs-var">visibleDataCons</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-type">AbstractTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1067"></span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var">visibleDataCons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815448"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815448"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815448"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1068"></span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var">visibleDataCons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815447"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815447"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815447"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1069"></span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var">visibleDataCons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815446"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815446"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815446"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1070"></span><span class="annot"><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var">visibleDataCons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815445"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815445"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815445"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1071"></span><span>
</span><span id="line-1072"></span><span class="hs-comment">-- ^ Both type classes as well as family instances imply implicit</span><span>
</span><span id="line-1073"></span><span class="hs-comment">-- type constructors.  These implicit type constructors refer to their parent</span><span>
</span><span id="line-1074"></span><span class="hs-comment">-- structure (ie, the class or family from which they derive) using a type of</span><span>
</span><span id="line-1075"></span><span class="hs-comment">-- the following form.</span><span>
</span><span id="line-1076"></span><span class="hs-keyword">data</span><span> </span><span id="AlgTyConFlav"><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-var">AlgTyConFlav</span></a></span></span><span>
</span><span id="line-1077"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- | An ordinary type constructor has no parent.</span><span>
</span><span id="line-1078"></span><span>    </span><span id="VanillaAlgTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-var">VanillaAlgTyCon</span></a></span></span><span>
</span><span id="line-1079"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>   </span><span class="hs-comment">-- For Typeable</span><span>
</span><span id="line-1080"></span><span>
</span><span id="line-1081"></span><span>    </span><span class="hs-comment">-- | An unboxed type constructor. The TyConRepName is a Maybe since we</span><span>
</span><span id="line-1082"></span><span>    </span><span class="hs-comment">-- currently don't allow unboxed sums to be Typeable since there are too</span><span>
</span><span id="line-1083"></span><span>    </span><span class="hs-comment">-- many of them. See #13276.</span><span>
</span><span id="line-1084"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="UnboxedAlgTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#UnboxedAlgTyCon"><span class="hs-identifier hs-var">UnboxedAlgTyCon</span></a></span></span><span>
</span><span id="line-1085"></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1086"></span><span>
</span><span id="line-1087"></span><span>  </span><span class="hs-comment">-- | Type constructors representing a class dictionary.</span><span>
</span><span id="line-1088"></span><span>  </span><span class="hs-comment">-- See Note [ATyCon for classes] in &quot;GHC.Core.TyCo.Rep&quot;</span><span>
</span><span id="line-1089"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ClassTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-var">ClassTyCon</span></a></span></span><span>
</span><span id="line-1090"></span><span>        </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span>           </span><span class="hs-comment">-- INVARIANT: the classTyCon of this Class is the</span><span>
</span><span id="line-1091"></span><span>                        </span><span class="hs-comment">-- current tycon</span><span>
</span><span id="line-1092"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-1093"></span><span>
</span><span id="line-1094"></span><span>  </span><span class="hs-comment">-- | Type constructors representing an *instance* of a *data* family.</span><span>
</span><span id="line-1095"></span><span>  </span><span class="hs-comment">-- Parameters:</span><span>
</span><span id="line-1096"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1097"></span><span>  </span><span class="hs-comment">--  1) The type family in question</span><span>
</span><span id="line-1098"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1099"></span><span>  </span><span class="hs-comment">--  2) Instance types; free variables are the 'tyConTyVars'</span><span>
</span><span id="line-1100"></span><span>  </span><span class="hs-comment">--  of the current 'TyCon' (not the family one). INVARIANT:</span><span>
</span><span id="line-1101"></span><span>  </span><span class="hs-comment">--  the number of types matches the arity of the family 'TyCon'</span><span>
</span><span id="line-1102"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1103"></span><span>  </span><span class="hs-comment">--  3) A 'CoTyCon' identifying the representation</span><span>
</span><span id="line-1104"></span><span>  </span><span class="hs-comment">--  type with the type instance family</span><span>
</span><span id="line-1105"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DataFamInstTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-var">DataFamInstTyCon</span></a></span></span><span>          </span><span class="hs-comment">-- See Note [Data type families]</span><span>
</span><span id="line-1106"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- The coercion axiom.</span><span>
</span><span id="line-1107"></span><span>               </span><span class="hs-comment">-- A *Representational* coercion,</span><span>
</span><span id="line-1108"></span><span>               </span><span class="hs-comment">-- of kind   T ty1 ty2   ~R   R:T a b c</span><span>
</span><span id="line-1109"></span><span>               </span><span class="hs-comment">-- where T is the family TyCon,</span><span>
</span><span id="line-1110"></span><span>               </span><span class="hs-comment">-- and R:T is the representation TyCon (ie this one)</span><span>
</span><span id="line-1111"></span><span>               </span><span class="hs-comment">-- and a,b,c are the tyConTyVars of this TyCon</span><span>
</span><span id="line-1112"></span><span>               </span><span class="hs-comment">--</span><span>
</span><span id="line-1113"></span><span>               </span><span class="hs-comment">-- BUT may be eta-reduced; see</span><span>
</span><span id="line-1114"></span><span>               </span><span class="hs-comment">--     Note [Eta reduction for data families] in</span><span>
</span><span id="line-1115"></span><span>               </span><span class="hs-comment">--     GHC.Core.Coercion.Axiom</span><span>
</span><span id="line-1116"></span><span>
</span><span id="line-1117"></span><span>          </span><span class="hs-comment">-- Cached fields of the CoAxiom, but adjusted to</span><span>
</span><span id="line-1118"></span><span>          </span><span class="hs-comment">-- use the tyConTyVars of this TyCon</span><span>
</span><span id="line-1119"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>   </span><span class="hs-comment">-- The family TyCon</span><span>
</span><span id="line-1120"></span><span>        </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- Argument types (mentions the tyConTyVars of this TyCon)</span><span>
</span><span id="line-1121"></span><span>                </span><span class="hs-comment">-- No shorter in length than the tyConTyVars of the family TyCon</span><span>
</span><span id="line-1122"></span><span>                </span><span class="hs-comment">-- How could it be longer? See [Arity of data families] in GHC.Core.FamInstEnv</span><span>
</span><span id="line-1123"></span><span>
</span><span id="line-1124"></span><span>        </span><span class="hs-comment">-- E.g.  data instance T [a] = ...</span><span>
</span><span id="line-1125"></span><span>        </span><span class="hs-comment">-- gives a representation tycon:</span><span>
</span><span id="line-1126"></span><span>        </span><span class="hs-comment">--      data R:TList a = ...</span><span>
</span><span id="line-1127"></span><span>        </span><span class="hs-comment">--      axiom co a :: T [a] ~ R:TList a</span><span>
</span><span id="line-1128"></span><span>        </span><span class="hs-comment">-- with R:TList's algTcParent = DataFamInstTyCon T [a] co</span><span>
</span><span id="line-1129"></span><span>
</span><span id="line-1130"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815438"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1131"></span><span>    </span><span id="local-6989586621680815434"><span class="annot"><span class="annottext">ppr :: AlgTyConFlav -&gt; SDoc
</span><a href="#local-6989586621680815434"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-type">VanillaAlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Vanilla ADT&quot;</span></span><span>
</span><span id="line-1132"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#UnboxedAlgTyCon"><span class="hs-identifier hs-type">UnboxedAlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unboxed ADT&quot;</span></span><span>
</span><span id="line-1133"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span id="local-6989586621680815433"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815433"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Class parent&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Class -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815433"><span class="hs-identifier hs-var">cls</span></a></span><span>
</span><span id="line-1134"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815432"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815432"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680815431"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815431"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Family parent (family instance)&quot;</span></span><span>
</span><span id="line-1135"></span><span>                                      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815432"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Kind -&gt; SDoc) -&gt; [Kind] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; SDoc
</span><a href="GHC.Core.TyCo.Ppr.html#pprType"><span class="hs-identifier hs-var">pprType</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815431"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1136"></span><span>
</span><span id="line-1137"></span><span class="hs-comment">-- | Checks the invariants of a 'AlgTyConFlav' given the appropriate type class</span><span>
</span><span id="line-1138"></span><span class="hs-comment">-- name, if any</span><span>
</span><span id="line-1139"></span><span class="annot"><a href="GHC.Core.TyCon.html#okParent"><span class="hs-identifier hs-type">okParent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1140"></span><span id="okParent"><span class="annot"><span class="annottext">okParent :: Name -&gt; AlgTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#okParent"><span class="hs-identifier hs-var hs-var">okParent</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-type">VanillaAlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1141"></span><span class="annot"><a href="GHC.Core.TyCon.html#okParent"><span class="hs-identifier hs-var">okParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#UnboxedAlgTyCon"><span class="hs-identifier hs-type">UnboxedAlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1142"></span><span class="annot"><a href="GHC.Core.TyCon.html#okParent"><span class="hs-identifier hs-var">okParent</span></a></span><span> </span><span id="local-6989586621680815428"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815428"><span class="hs-identifier hs-var">tc_name</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span id="local-6989586621680815427"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815427"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815428"><span class="hs-identifier hs-var">tc_name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Class -&gt; TyCon
</span><a href="GHC.Core.Class.html#classTyCon"><span class="hs-identifier hs-var hs-var">classTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815427"><span class="hs-identifier hs-var">cls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1143"></span><span class="annot"><a href="GHC.Core.TyCon.html#okParent"><span class="hs-identifier hs-var">okParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815425"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815425"><span class="hs-identifier hs-var">fam_tc</span></a></span></span><span> </span><span id="local-6989586621680815424"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815424"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815424"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthAtLeast"><span class="hs-operator hs-var">`lengthAtLeast`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var hs-var">tyConArity</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815425"><span class="hs-identifier hs-var">fam_tc</span></a></span><span>
</span><span id="line-1144"></span><span>
</span><span id="line-1145"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNoParent"><span class="hs-identifier hs-type">isNoParent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1146"></span><span id="isNoParent"><span class="annot"><span class="annottext">isNoParent :: AlgTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNoParent"><span class="hs-identifier hs-var hs-var">isNoParent</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-type">VanillaAlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1147"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNoParent"><span class="hs-identifier hs-var">isNoParent</span></a></span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1148"></span><span>
</span><span id="line-1149"></span><span class="hs-comment">--------------------</span><span>
</span><span id="line-1150"></span><span>
</span><span id="line-1151"></span><span class="hs-keyword">data</span><span> </span><span id="Injectivity"><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier hs-var">Injectivity</span></a></span></span><span>
</span><span id="line-1152"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="NotInjective"><span class="annot"><a href="GHC.Core.TyCon.html#NotInjective"><span class="hs-identifier hs-var">NotInjective</span></a></span></span><span>
</span><span id="line-1153"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Injective"><span class="annot"><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-var">Injective</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- 1-1 with tyConTyVars (incl kind vars)</span><span>
</span><span id="line-1154"></span><span>  </span><span class="hs-keyword">deriving</span><span class="hs-special">(</span><span> </span><span id="local-6989586621680815415"><span id="local-6989586621680815419"><span class="annot"><span class="annottext">Injectivity -&gt; Injectivity -&gt; Bool
(Injectivity -&gt; Injectivity -&gt; Bool)
-&gt; (Injectivity -&gt; Injectivity -&gt; Bool) -&gt; Eq Injectivity
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Injectivity -&gt; Injectivity -&gt; Bool
$c/= :: Injectivity -&gt; Injectivity -&gt; Bool
== :: Injectivity -&gt; Injectivity -&gt; Bool
$c== :: Injectivity -&gt; Injectivity -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1155"></span><span>
</span><span id="line-1156"></span><span class="hs-comment">-- | Information pertaining to the expansion of a type synonym (@type@)</span><span>
</span><span id="line-1157"></span><span class="hs-keyword">data</span><span> </span><span id="FamTyConFlav"><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-var">FamTyConFlav</span></a></span></span><span>
</span><span id="line-1158"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- | Represents an open type family without a fixed right hand</span><span>
</span><span id="line-1159"></span><span>    </span><span class="hs-comment">-- side.  Additional instances can appear at any time.</span><span>
</span><span id="line-1160"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-1161"></span><span>    </span><span class="hs-comment">-- These are introduced by either a top level declaration:</span><span>
</span><span id="line-1162"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-1163"></span><span>    </span><span class="hs-comment">-- &gt; data family T a :: *</span><span>
</span><span id="line-1164"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-1165"></span><span>    </span><span class="hs-comment">-- Or an associated data type declaration, within a class declaration:</span><span>
</span><span id="line-1166"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-1167"></span><span>    </span><span class="hs-comment">-- &gt; class C a b where</span><span>
</span><span id="line-1168"></span><span>    </span><span class="hs-comment">-- &gt;   data T b :: *</span><span>
</span><span id="line-1169"></span><span>     </span><span id="DataFamilyTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-var">DataFamilyTyCon</span></a></span></span><span>
</span><span id="line-1170"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-1171"></span><span>
</span><span id="line-1172"></span><span>     </span><span class="hs-comment">-- | An open type synonym family  e.g. @type family F x y :: * -&gt; *@</span><span>
</span><span id="line-1173"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="OpenSynFamilyTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#OpenSynFamilyTyCon"><span class="hs-identifier hs-var">OpenSynFamilyTyCon</span></a></span></span><span>
</span><span id="line-1174"></span><span>
</span><span id="line-1175"></span><span>   </span><span class="hs-comment">-- | A closed type synonym family  e.g.</span><span>
</span><span id="line-1176"></span><span>   </span><span class="hs-comment">-- @type family F x where { F Int = Bool }@</span><span>
</span><span id="line-1177"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="ClosedSynFamilyTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#ClosedSynFamilyTyCon"><span class="hs-identifier hs-var">ClosedSynFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Branched"><span class="hs-identifier hs-type">Branched</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1178"></span><span>     </span><span class="hs-comment">-- See Note [Closed type families]</span><span>
</span><span id="line-1179"></span><span>
</span><span id="line-1180"></span><span>   </span><span class="hs-comment">-- | A closed type synonym family declared in an hs-boot file with</span><span>
</span><span id="line-1181"></span><span>   </span><span class="hs-comment">-- type family F a where ..</span><span>
</span><span id="line-1182"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="AbstractClosedSynFamilyTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#AbstractClosedSynFamilyTyCon"><span class="hs-identifier hs-var">AbstractClosedSynFamilyTyCon</span></a></span></span><span>
</span><span id="line-1183"></span><span>
</span><span id="line-1184"></span><span>   </span><span class="hs-comment">-- | Built-in type family used by the TypeNats solver</span><span>
</span><span id="line-1185"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="BuiltInSynFamTyCon"><span class="annot"><a href="GHC.Core.TyCon.html#BuiltInSynFamTyCon"><span class="hs-identifier hs-var">BuiltInSynFamTyCon</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#BuiltInSynFamily"><span class="hs-identifier hs-type">BuiltInSynFamily</span></a></span><span>
</span><span id="line-1186"></span><span>
</span><span id="line-1187"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815406"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-type">FamTyConFlav</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1188"></span><span>    </span><span id="local-6989586621680815402"><span class="annot"><span class="annottext">ppr :: FamTyConFlav -&gt; SDoc
</span><a href="#local-6989586621680815402"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span id="local-6989586621680815401"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815401"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;data family&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815401"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-1189"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#OpenSynFamilyTyCon"><span class="hs-identifier hs-var">OpenSynFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;open type family&quot;</span></span><span>
</span><span id="line-1190"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#ClosedSynFamilyTyCon"><span class="hs-identifier hs-type">ClosedSynFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CoAxiom Branched)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;closed type family&quot;</span></span><span>
</span><span id="line-1191"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#ClosedSynFamilyTyCon"><span class="hs-identifier hs-type">ClosedSynFamilyTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680815400"><span class="annot"><span class="annottext">CoAxiom Branched
</span><a href="#local-6989586621680815400"><span class="hs-identifier hs-var">coax</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;closed type family&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched
</span><a href="#local-6989586621680815400"><span class="hs-identifier hs-var">coax</span></a></span><span>
</span><span id="line-1192"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#AbstractClosedSynFamilyTyCon"><span class="hs-identifier hs-var">AbstractClosedSynFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;abstract closed type family&quot;</span></span><span>
</span><span id="line-1193"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#BuiltInSynFamTyCon"><span class="hs-identifier hs-type">BuiltInSynFamTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">BuiltInSynFamily
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;built-in type family&quot;</span></span><span>
</span><span id="line-1194"></span><span>
</span><span id="line-1195"></span><span class="hs-comment">{- Note [Closed type families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* In an open type family you can add new instances later.  This is the
  usual case.

* In a closed type family you can only put equations where the family
  is defined.

A non-empty closed type family has a single axiom with multiple
branches, stored in the 'ClosedSynFamilyTyCon' constructor.  A closed
type family with no equations does not have an axiom, because there is
nothing for the axiom to prove!


Note [Promoted data constructors]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All data constructors can be promoted to become a type constructor,
via the PromotedDataCon alternative in GHC.Core.TyCon.

* The TyCon promoted from a DataCon has the *same* Name and Unique as
  the DataCon.  Eg. If the data constructor Data.Maybe.Just(unique 78,
  say) is promoted to a TyCon whose name is Data.Maybe.Just(unique 78)

* We promote the *user* type of the DataCon.  Eg
     data T = MkT {-# UNPACK #-} !(Bool, Bool)
  The promoted kind is
     'MkT :: (Bool,Bool) -&gt; T
  *not*
     'MkT :: Bool -&gt; Bool -&gt; T

* Similarly for GADTs:
     data G a where
       MkG :: forall b. b -&gt; G [b]
  The promoted data constructor has kind
       'MkG :: forall b. b -&gt; G [b]
  *not*
       'MkG :: forall a b. (a ~# [b]) =&gt; b -&gt; G a

Note [Enumeration types]
~~~~~~~~~~~~~~~~~~~~~~~~
We define datatypes with no constructors to *not* be
enumerations; this fixes trac #2578,  Otherwise we
end up generating an empty table for
  &lt;mod&gt;_&lt;type&gt;_closure_tbl
which is used by tagToEnum# to map Int# to constructors
in an enumeration. The empty table apparently upset
the linker.

Moreover, all the data constructor must be enumerations, meaning
they have type  (forall abc. T a b c).  GADTs are not enumerations.
For example consider
    data T a where
      T1 :: T Int
      T2 :: T Bool
      T3 :: T a
What would [T1 ..] be?  [T1,T3] :: T Int? Easiest thing is to exclude them.
See #4528.

Note [Newtype coercions]
~~~~~~~~~~~~~~~~~~~~~~~~
The NewTyCon field nt_co is a CoAxiom which is used for coercing from
the representation type of the newtype, to the newtype itself. For
example,

   newtype T a = MkT (a -&gt; a)

the NewTyCon for T will contain nt_co = CoT where CoT :: forall a. T a ~ a -&gt; a.

We might also eta-contract the axiom: see Note [Newtype eta].

Note [Newtype eta]
~~~~~~~~~~~~~~~~~~
Consider
        newtype Parser a = MkParser (IO a) deriving Monad
Are these two types equal (that is, does a coercion exist between them)?
        Monad Parser
        Monad IO
which we need to make the derived instance for Monad Parser.

Well, yes.  But to see that easily we eta-reduce the RHS type of
Parser, in this case to IO, so that even unsaturated applications
of Parser will work right.  This eta reduction is done when the type
constructor is built, and cached in NewTyCon.

Here's an example that I think showed up in practice
Source code:
        newtype T a = MkT [a]
        newtype Foo m = MkFoo (forall a. m a -&gt; Int)

        w1 :: Foo []
        w1 = ...

        w2 :: Foo T
        w2 = MkFoo (\(MkT x) -&gt; case w1 of MkFoo f -&gt; f x)

After desugaring, and discarding the data constructors for the newtypes,
we get:
        w2 = w1 `cast` Foo CoT
so the coercion tycon CoT must have
        kind:    T ~ []
 and    arity:   0

This eta-reduction is implemented in GHC.Tc.TyCl.Build.mkNewTyConRhs.


************************************************************************
*                                                                      *
                 TyConRepName
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-1305"></span><span>
</span><span id="line-1306"></span><span class="hs-keyword">type</span><span> </span><span id="TyConRepName"><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-var">TyConRepName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1307"></span><span>   </span><span class="hs-comment">-- The Name of the top-level declaration for the Typeable world</span><span>
</span><span id="line-1308"></span><span>   </span><span class="hs-comment">--    $tcMaybe :: Data.Typeable.Internal.TyCon</span><span>
</span><span id="line-1309"></span><span>   </span><span class="hs-comment">--    $tcMaybe = TyCon { tyConName = &quot;Maybe&quot;, ... }</span><span>
</span><span id="line-1310"></span><span>
</span><span id="line-1311"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-type">tyConRepName_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-1312"></span><span id="tyConRepName_maybe"><span class="annot"><span class="annottext">tyConRepName_maybe :: TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var hs-var">tyConRepName_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span>   </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcRepName :: TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var">tcRepName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815399"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815399"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1313"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815399"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1314"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">primRepName :: TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#primRepName"><span class="hs-identifier hs-var">primRepName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815398"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815398"><span class="hs-identifier hs-var">mb_rep_nm</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1315"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815398"><span class="hs-identifier hs-var">mb_rep_nm</span></a></span><span>
</span><span id="line-1316"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815397"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815397"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1317"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-type">VanillaAlgTyCon</span></a></span><span> </span><span id="local-6989586621680815396"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815396"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815397"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815396"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1318"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815395"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815395"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815397"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815395"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1319"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#UnboxedAlgTyCon"><span class="hs-identifier hs-type">UnboxedAlgTyCon</span></a></span><span> </span><span id="local-6989586621680815394"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815394"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815397"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815394"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1320"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span id="local-6989586621680815393"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815393"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1321"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815393"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1322"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">dataCon :: TyCon -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#dataCon"><span class="hs-identifier hs-var">dataCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815392"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815392"><span class="hs-identifier hs-var">dc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcRepName :: TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var">tcRepName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815391"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815391"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1323"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Core.DataCon.html#isUnboxedSumCon"><span class="hs-identifier hs-var">isUnboxedSumCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815392"><span class="hs-identifier hs-var">dc</span></a></span><span>   </span><span class="hs-comment">-- see #13276</span><span>
</span><span id="line-1324"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1325"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1326"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815391"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1327"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1328"></span><span>
</span><span id="line-1329"></span><span class="hs-comment">-- | Make a 'Name' for the 'Typeable' representation of the given wired-in type</span><span>
</span><span id="line-1330"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkPrelTyConRepName"><span class="hs-identifier hs-type">mkPrelTyConRepName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-1331"></span><span class="hs-comment">-- See Note [Grand plan for Typeable] in &quot;GHC.Tc.Instance.Typeable&quot;.</span><span>
</span><span id="line-1332"></span><span id="mkPrelTyConRepName"><span class="annot"><span class="annottext">mkPrelTyConRepName :: Name -&gt; Name
</span><a href="GHC.Core.TyCon.html#mkPrelTyConRepName"><span class="hs-identifier hs-var hs-var">mkPrelTyConRepName</span></a></span></span><span> </span><span id="local-6989586621680815390"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815390"><span class="hs-identifier hs-var">tc_name</span></a></span></span><span>  </span><span class="hs-comment">-- Prelude tc_name is always External,</span><span>
</span><span id="line-1333"></span><span>                            </span><span class="hs-comment">-- so nameModule will work</span><span>
</span><span id="line-1334"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680815388"><span class="hs-identifier hs-var">rep_uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815387"><span class="hs-identifier hs-var">rep_mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815386"><span class="hs-identifier hs-var">rep_occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815390"><span class="hs-identifier hs-var">tc_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1335"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1336"></span><span>    </span><span id="local-6989586621680815384"><span class="annot"><span class="annottext">name_occ :: OccName
</span><a href="#local-6989586621680815384"><span class="hs-identifier hs-var hs-var">name_occ</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815390"><span class="hs-identifier hs-var">tc_name</span></a></span><span>
</span><span id="line-1337"></span><span>    </span><span id="local-6989586621680815380"><span class="annot"><span class="annottext">name_mod :: Module
</span><a href="#local-6989586621680815380"><span class="hs-identifier hs-var hs-var">name_mod</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Module
Name -&gt; Module
</span><a href="GHC.Types.Name.html#nameModule"><span class="hs-identifier hs-var">nameModule</span></a></span><span>  </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815390"><span class="hs-identifier hs-var">tc_name</span></a></span><span>
</span><span id="line-1338"></span><span>    </span><span id="local-6989586621680815378"><span class="annot"><span class="annottext">name_uniq :: Unique
</span><a href="#local-6989586621680815378"><span class="hs-identifier hs-var hs-var">name_uniq</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span>  </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815390"><span class="hs-identifier hs-var">tc_name</span></a></span><span>
</span><span id="line-1339"></span><span>    </span><span id="local-6989586621680815388"><span class="annot"><span class="annottext">rep_uniq :: Unique
</span><a href="#local-6989586621680815388"><span class="hs-identifier hs-var hs-var">rep_uniq</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#isTcOcc"><span class="hs-identifier hs-var">isTcOcc</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815384"><span class="hs-identifier hs-var">name_occ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique
</span><a href="GHC.Types.Unique.html#tyConRepNameUnique"><span class="hs-identifier hs-var">tyConRepNameUnique</span></a></span><span>   </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680815378"><span class="hs-identifier hs-var">name_uniq</span></a></span><span>
</span><span id="line-1340"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique
</span><a href="GHC.Types.Unique.html#dataConTyRepNameUnique"><span class="hs-identifier hs-var">dataConTyRepNameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680815378"><span class="hs-identifier hs-var">name_uniq</span></a></span><span>
</span><span id="line-1341"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680815387"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815387"><span class="hs-identifier hs-var">rep_mod</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815386"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815386"><span class="hs-identifier hs-var">rep_occ</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; (Module, OccName)
</span><a href="GHC.Core.TyCon.html#tyConRepModOcc"><span class="hs-identifier hs-var">tyConRepModOcc</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815380"><span class="hs-identifier hs-var">name_mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815384"><span class="hs-identifier hs-var">name_occ</span></a></span><span>
</span><span id="line-1342"></span><span>
</span><span id="line-1343"></span><span class="hs-comment">-- | The name (and defining module) for the Typeable representation (TyCon) of a</span><span>
</span><span id="line-1344"></span><span class="hs-comment">-- type constructor.</span><span>
</span><span id="line-1345"></span><span class="hs-comment">--</span><span>
</span><span id="line-1346"></span><span class="hs-comment">-- See Note [Grand plan for Typeable] in &quot;GHC.Tc.Instance.Typeable&quot;.</span><span>
</span><span id="line-1347"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRepModOcc"><span class="hs-identifier hs-type">tyConRepModOcc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1348"></span><span id="tyConRepModOcc"><span class="annot"><span class="annottext">tyConRepModOcc :: Module -&gt; OccName -&gt; (Module, OccName)
</span><a href="GHC.Core.TyCon.html#tyConRepModOcc"><span class="hs-identifier hs-var hs-var">tyConRepModOcc</span></a></span></span><span> </span><span id="local-6989586621680815375"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815375"><span class="hs-identifier hs-var">tc_module</span></a></span></span><span> </span><span id="local-6989586621680815374"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815374"><span class="hs-identifier hs-var">tc_occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815373"><span class="hs-identifier hs-var">rep_module</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyConRepOcc"><span class="hs-identifier hs-var">mkTyConRepOcc</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621680815374"><span class="hs-identifier hs-var">tc_occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1349"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1350"></span><span>    </span><span id="local-6989586621680815373"><span class="annot"><span class="annottext">rep_module :: Module
</span><a href="#local-6989586621680815373"><span class="hs-identifier hs-var hs-var">rep_module</span></a></span></span><span>
</span><span id="line-1351"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815375"><span class="hs-identifier hs-var">tc_module</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; Module -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM"><span class="hs-identifier hs-var">gHC_PRIM</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_TYPES"><span class="hs-identifier hs-var">gHC_TYPES</span></a></span><span>
</span><span id="line-1352"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680815375"><span class="hs-identifier hs-var">tc_module</span></a></span><span>
</span><span id="line-1353"></span><span>
</span><span id="line-1354"></span><span>
</span><span id="line-1355"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                 PrimRep
*                                                                      *
************************************************************************

Note [rep swamp]

GHC has a rich selection of types that represent &quot;primitive types&quot; of
one kind or another.  Each of them makes a different set of
distinctions, and mostly the differences are for good reasons,
although it's probably true that we could merge some of these.

Roughly in order of &quot;includes more information&quot;:

 - A Width (&quot;GHC.Cmm.Type&quot;) is simply a binary value with the specified
   number of bits.  It may represent a signed or unsigned integer, a
   floating-point value, or an address.

    data Width = W8 | W16 | W32 | W64  | W128

 - Size, which is used in the native code generator, is Width +
   floating point information.

   data Size = II8 | II16 | II32 | II64 | FF32 | FF64

   it is necessary because e.g. the instruction to move a 64-bit float
   on x86 (movsd) is different from the instruction to move a 64-bit
   integer (movq), so the mov instruction is parameterised by Size.

 - CmmType wraps Width with more information: GC ptr, float, or
   other value.

    data CmmType = CmmType CmmCat Width

    data CmmCat     -- &quot;Category&quot; (not exported)
       = GcPtrCat   -- GC pointer
       | BitsCat    -- Non-pointer
       | FloatCat   -- Float

   It is important to have GcPtr information in Cmm, since we generate
   info tables containing pointerhood for the GC from this.  As for
   why we have float (and not signed/unsigned) here, see Note [Signed
   vs unsigned].

 - ArgRep makes only the distinctions necessary for the call and
   return conventions of the STG machine.  It is essentially CmmType
   + void.

 - PrimRep makes a few more distinctions than ArgRep: it divides
   non-GC-pointers into signed/unsigned and addresses, information
   that is necessary for passing these values to foreign functions.

There's another tension here: whether the type encodes its size in
bytes, or whether its size depends on the machine word size.  Width
and CmmType have the size built-in, whereas ArgRep and PrimRep do not.

This means to turn an ArgRep/PrimRep into a CmmType requires DynFlags.

On the other hand, CmmType includes some &quot;nonsense&quot; values, such as
CmmType GcPtrCat W32 on a 64-bit machine.

The PrimRep type is closely related to the user-visible RuntimeRep type.
See Note [RuntimeRep and PrimRep] in GHC.Types.RepType.

-}</span><span>
</span><span id="line-1421"></span><span>
</span><span id="line-1422"></span><span class="hs-comment">-- | A 'PrimRep' is an abstraction of a type.  It contains information that</span><span>
</span><span id="line-1423"></span><span class="hs-comment">-- the code generator needs in order to pass arguments, return results,</span><span>
</span><span id="line-1424"></span><span class="hs-comment">-- and store values of this type. See also Note [RuntimeRep and PrimRep] in</span><span>
</span><span id="line-1425"></span><span class="hs-comment">-- &quot;GHC.Types.RepType&quot; and Note [VoidRep] in &quot;GHC.Types.RepType&quot;.</span><span>
</span><span id="line-1426"></span><span class="hs-keyword">data</span><span> </span><span id="PrimRep"><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-var">PrimRep</span></a></span></span><span>
</span><span id="line-1427"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="VoidRep"><span class="annot"><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span></span><span>
</span><span id="line-1428"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LiftedRep"><span class="annot"><a href="GHC.Core.TyCon.html#LiftedRep"><span class="hs-identifier hs-var">LiftedRep</span></a></span></span><span>
</span><span id="line-1429"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="UnliftedRep"><span class="annot"><a href="GHC.Core.TyCon.html#UnliftedRep"><span class="hs-identifier hs-var">UnliftedRep</span></a></span></span><span>   </span><span class="hs-comment">-- ^ Unlifted pointer</span><span>
</span><span id="line-1430"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int8Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Int8Rep"><span class="hs-identifier hs-var">Int8Rep</span></a></span></span><span>       </span><span class="hs-comment">-- ^ Signed, 8-bit value</span><span>
</span><span id="line-1431"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int16Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Int16Rep"><span class="hs-identifier hs-var">Int16Rep</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Signed, 16-bit value</span><span>
</span><span id="line-1432"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int32Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Int32Rep"><span class="hs-identifier hs-var">Int32Rep</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Signed, 32-bit value</span><span>
</span><span id="line-1433"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int64Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Int64Rep"><span class="hs-identifier hs-var">Int64Rep</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Signed, 64 bit value (with 32-bit words only)</span><span>
</span><span id="line-1434"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="IntRep"><span class="annot"><a href="GHC.Core.TyCon.html#IntRep"><span class="hs-identifier hs-var">IntRep</span></a></span></span><span>        </span><span class="hs-comment">-- ^ Signed, word-sized value</span><span>
</span><span id="line-1435"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word8Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Word8Rep"><span class="hs-identifier hs-var">Word8Rep</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Unsigned, 8 bit value</span><span>
</span><span id="line-1436"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word16Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Word16Rep"><span class="hs-identifier hs-var">Word16Rep</span></a></span></span><span>     </span><span class="hs-comment">-- ^ Unsigned, 16 bit value</span><span>
</span><span id="line-1437"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word32Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Word32Rep"><span class="hs-identifier hs-var">Word32Rep</span></a></span></span><span>     </span><span class="hs-comment">-- ^ Unsigned, 32 bit value</span><span>
</span><span id="line-1438"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word64Rep"><span class="annot"><a href="GHC.Core.TyCon.html#Word64Rep"><span class="hs-identifier hs-var">Word64Rep</span></a></span></span><span>     </span><span class="hs-comment">-- ^ Unsigned, 64 bit value (with 32-bit words only)</span><span>
</span><span id="line-1439"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="WordRep"><span class="annot"><a href="GHC.Core.TyCon.html#WordRep"><span class="hs-identifier hs-var">WordRep</span></a></span></span><span>       </span><span class="hs-comment">-- ^ Unsigned, word-sized value</span><span>
</span><span id="line-1440"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="AddrRep"><span class="annot"><a href="GHC.Core.TyCon.html#AddrRep"><span class="hs-identifier hs-var">AddrRep</span></a></span></span><span>       </span><span class="hs-comment">-- ^ A pointer, but /not/ to a Haskell value (use '(Un)liftedRep')</span><span>
</span><span id="line-1441"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FloatRep"><span class="annot"><a href="GHC.Core.TyCon.html#FloatRep"><span class="hs-identifier hs-var">FloatRep</span></a></span></span><span>
</span><span id="line-1442"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DoubleRep"><span class="annot"><a href="GHC.Core.TyCon.html#DoubleRep"><span class="hs-identifier hs-var">DoubleRep</span></a></span></span><span>
</span><span id="line-1443"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="VecRep"><span class="annot"><a href="GHC.Core.TyCon.html#VecRep"><span class="hs-identifier hs-var">VecRep</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier hs-type">PrimElemRep</span></a></span><span>  </span><span class="hs-comment">-- ^ A vector</span><span>
</span><span id="line-1444"></span><span>  </span><span class="hs-keyword">deriving</span><span class="hs-special">(</span><span> </span><span id="local-6989586621680815339"><span id="local-6989586621680815341"><span id="local-6989586621680815347"><span class="annot"><span class="annottext">Int -&gt; PrimRep -&gt; ShowS
[PrimRep] -&gt; ShowS
PrimRep -&gt; String
(Int -&gt; PrimRep -&gt; ShowS)
-&gt; (PrimRep -&gt; String) -&gt; ([PrimRep] -&gt; ShowS) -&gt; Show PrimRep
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [PrimRep] -&gt; ShowS
$cshowList :: [PrimRep] -&gt; ShowS
show :: PrimRep -&gt; String
$cshow :: PrimRep -&gt; String
showsPrec :: Int -&gt; PrimRep -&gt; ShowS
$cshowsPrec :: Int -&gt; PrimRep -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1445"></span><span>
</span><span id="line-1446"></span><span class="hs-keyword">data</span><span> </span><span id="PrimElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier hs-var">PrimElemRep</span></a></span></span><span>
</span><span id="line-1447"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Int8ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Int8ElemRep"><span class="hs-identifier hs-var">Int8ElemRep</span></a></span></span><span>
</span><span id="line-1448"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int16ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Int16ElemRep"><span class="hs-identifier hs-var">Int16ElemRep</span></a></span></span><span>
</span><span id="line-1449"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int32ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Int32ElemRep"><span class="hs-identifier hs-var">Int32ElemRep</span></a></span></span><span>
</span><span id="line-1450"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Int64ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Int64ElemRep"><span class="hs-identifier hs-var">Int64ElemRep</span></a></span></span><span>
</span><span id="line-1451"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word8ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Word8ElemRep"><span class="hs-identifier hs-var">Word8ElemRep</span></a></span></span><span>
</span><span id="line-1452"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word16ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Word16ElemRep"><span class="hs-identifier hs-var">Word16ElemRep</span></a></span></span><span>
</span><span id="line-1453"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word32ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Word32ElemRep"><span class="hs-identifier hs-var">Word32ElemRep</span></a></span></span><span>
</span><span id="line-1454"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Word64ElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#Word64ElemRep"><span class="hs-identifier hs-var">Word64ElemRep</span></a></span></span><span>
</span><span id="line-1455"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FloatElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#FloatElemRep"><span class="hs-identifier hs-var">FloatElemRep</span></a></span></span><span>
</span><span id="line-1456"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DoubleElemRep"><span class="annot"><a href="GHC.Core.TyCon.html#DoubleElemRep"><span class="hs-identifier hs-var">DoubleElemRep</span></a></span></span><span>
</span><span id="line-1457"></span><span>   </span><span class="hs-keyword">deriving</span><span class="hs-special">(</span><span> </span><span id="local-6989586621680815324"><span id="local-6989586621680815326"><span class="annot"><span class="annottext">PrimElemRep -&gt; PrimElemRep -&gt; Bool
(PrimElemRep -&gt; PrimElemRep -&gt; Bool)
-&gt; (PrimElemRep -&gt; PrimElemRep -&gt; Bool) -&gt; Eq PrimElemRep
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: PrimElemRep -&gt; PrimElemRep -&gt; Bool
$c/= :: PrimElemRep -&gt; PrimElemRep -&gt; Bool
== :: PrimElemRep -&gt; PrimElemRep -&gt; Bool
$c== :: PrimElemRep -&gt; PrimElemRep -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680815318"><span id="local-6989586621680815320"><span id="local-6989586621680815322"><span class="annot"><span class="annottext">Int -&gt; PrimElemRep -&gt; ShowS
[PrimElemRep] -&gt; ShowS
PrimElemRep -&gt; String
(Int -&gt; PrimElemRep -&gt; ShowS)
-&gt; (PrimElemRep -&gt; String)
-&gt; ([PrimElemRep] -&gt; ShowS)
-&gt; Show PrimElemRep
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [PrimElemRep] -&gt; ShowS
$cshowList :: [PrimElemRep] -&gt; ShowS
show :: PrimElemRep -&gt; String
$cshow :: PrimElemRep -&gt; String
showsPrec :: Int -&gt; PrimElemRep -&gt; ShowS
$cshowsPrec :: Int -&gt; PrimElemRep -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1458"></span><span>
</span><span id="line-1459"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815315"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1460"></span><span>  </span><span id="local-6989586621680815313"><span class="annot"><span class="annottext">ppr :: PrimRep -&gt; SDoc
</span><a href="#local-6989586621680815313"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680815312"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815312"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimRep -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815312"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1461"></span><span>
</span><span id="line-1462"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680815308"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier hs-type">PrimElemRep</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1463"></span><span>  </span><span id="local-6989586621680815306"><span class="annot"><span class="annottext">ppr :: PrimElemRep -&gt; SDoc
</span><a href="#local-6989586621680815306"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680815305"><span class="annot"><span class="annottext">PrimElemRep
</span><a href="#local-6989586621680815305"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimElemRep -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="#local-6989586621680815305"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1464"></span><span>
</span><span id="line-1465"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVoidRep"><span class="hs-identifier hs-type">isVoidRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1466"></span><span id="isVoidRep"><span class="annot"><span class="annottext">isVoidRep :: PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVoidRep"><span class="hs-identifier hs-var hs-var">isVoidRep</span></a></span></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1467"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVoidRep"><span class="hs-identifier hs-var">isVoidRep</span></a></span><span> </span><span id="local-6989586621680815304"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815304"><span class="hs-identifier hs-var">_other</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1468"></span><span>
</span><span id="line-1469"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-type">isGcPtrRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1470"></span><span id="isGcPtrRep"><span class="annot"><span class="annottext">isGcPtrRep :: PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var hs-var">isGcPtrRep</span></a></span></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#LiftedRep"><span class="hs-identifier hs-var">LiftedRep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1471"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#UnliftedRep"><span class="hs-identifier hs-var">UnliftedRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1472"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1473"></span><span>
</span><span id="line-1474"></span><span class="hs-comment">-- A PrimRep is compatible with another iff one can be coerced to the other.</span><span>
</span><span id="line-1475"></span><span class="hs-comment">-- See Note [bad unsafe coercion] in GHC.Core.Lint for when are two types coercible.</span><span>
</span><span id="line-1476"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepCompatible"><span class="hs-identifier hs-type">primRepCompatible</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1477"></span><span id="primRepCompatible"><span class="annot"><span class="annottext">primRepCompatible :: Platform -&gt; PrimRep -&gt; PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#primRepCompatible"><span class="hs-identifier hs-var hs-var">primRepCompatible</span></a></span></span><span> </span><span id="local-6989586621680815303"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815303"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621680815302"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815302"><span class="hs-identifier hs-var">rep1</span></a></span></span><span> </span><span id="local-6989586621680815301"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815301"><span class="hs-identifier hs-var">rep2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1478"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="#local-6989586621680815300"><span class="hs-identifier hs-var">isUnboxed</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815302"><span class="hs-identifier hs-var">rep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="#local-6989586621680815300"><span class="hs-identifier hs-var">isUnboxed</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815301"><span class="hs-identifier hs-var">rep2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-1479"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; PrimRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier hs-var">primRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815303"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815302"><span class="hs-identifier hs-var">rep1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; PrimRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier hs-var">primRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815303"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815301"><span class="hs-identifier hs-var">rep2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-1480"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimRep -&gt; Maybe Bool
</span><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var">primRepIsFloat</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815302"><span class="hs-identifier hs-var">rep1</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool -&gt; Maybe Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Maybe Bool
</span><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var">primRepIsFloat</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680815301"><span class="hs-identifier hs-var">rep2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1481"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1482"></span><span>    </span><span id="local-6989586621680815300"><span class="annot"><span class="annottext">isUnboxed :: PrimRep -&gt; Bool
</span><a href="#local-6989586621680815300"><span class="hs-identifier hs-var hs-var">isUnboxed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (PrimRep -&gt; Bool) -&gt; PrimRep -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGcPtrRep"><span class="hs-identifier hs-var">isGcPtrRep</span></a></span><span>
</span><span id="line-1483"></span><span>
</span><span id="line-1484"></span><span class="hs-comment">-- More general version of `primRepCompatible` for types represented by zero or</span><span>
</span><span id="line-1485"></span><span class="hs-comment">-- more than one PrimReps.</span><span>
</span><span id="line-1486"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepsCompatible"><span class="hs-identifier hs-type">primRepsCompatible</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1487"></span><span id="primRepsCompatible"><span class="annot"><span class="annottext">primRepsCompatible :: Platform -&gt; [PrimRep] -&gt; [PrimRep] -&gt; Bool
</span><a href="GHC.Core.TyCon.html#primRepsCompatible"><span class="hs-identifier hs-var hs-var">primRepsCompatible</span></a></span></span><span> </span><span id="local-6989586621680815298"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815298"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621680815297"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815297"><span class="hs-identifier hs-var">reps1</span></a></span></span><span> </span><span id="local-6989586621680815296"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815296"><span class="hs-identifier hs-var">reps2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1488"></span><span>    </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815297"><span class="hs-identifier hs-var">reps1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815296"><span class="hs-identifier hs-var">reps2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-1489"></span><span>    </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#and"><span class="hs-identifier hs-var">and</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(PrimRep -&gt; PrimRep -&gt; Bool) -&gt; [PrimRep] -&gt; [PrimRep] -&gt; [Bool]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; PrimRep -&gt; PrimRep -&gt; Bool
</span><a href="GHC.Core.TyCon.html#primRepCompatible"><span class="hs-identifier hs-var">primRepCompatible</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815298"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815297"><span class="hs-identifier hs-var">reps1</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680815296"><span class="hs-identifier hs-var">reps2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1490"></span><span>
</span><span id="line-1491"></span><span class="hs-comment">-- | The size of a 'PrimRep' in bytes.</span><span>
</span><span id="line-1492"></span><span class="hs-comment">--</span><span>
</span><span id="line-1493"></span><span class="hs-comment">-- This applies also when used in a constructor, where we allow packing the</span><span>
</span><span id="line-1494"></span><span class="hs-comment">-- fields. For instance, in @data Foo = Foo Float# Float#@ the two fields will</span><span>
</span><span id="line-1495"></span><span class="hs-comment">-- take only 8 bytes, which for 64-bit arch will be equal to 1 word.</span><span>
</span><span id="line-1496"></span><span class="hs-comment">-- See also mkVirtHeapOffsetsWithPadding for details of how data fields are</span><span>
</span><span id="line-1497"></span><span class="hs-comment">-- laid out.</span><span>
</span><span id="line-1498"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier hs-type">primRepSizeB</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-1499"></span><span id="primRepSizeB"><span class="annot"><span class="annottext">primRepSizeB :: Platform -&gt; PrimRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primRepSizeB"><span class="hs-identifier hs-var hs-var">primRepSizeB</span></a></span></span><span> </span><span id="local-6989586621680815293"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-1500"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#IntRep"><span class="hs-identifier hs-var">IntRep</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1501"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#WordRep"><span class="hs-identifier hs-var">WordRep</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1502"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int8Rep"><span class="hs-identifier hs-var">Int8Rep</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1503"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int16Rep"><span class="hs-identifier hs-var">Int16Rep</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-1504"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int32Rep"><span class="hs-identifier hs-var">Int32Rep</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-1505"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Int64Rep"><span class="hs-identifier hs-var">Int64Rep</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#wORD64_SIZE"><span class="hs-identifier hs-var">wORD64_SIZE</span></a></span><span>
</span><span id="line-1506"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word8Rep"><span class="hs-identifier hs-var">Word8Rep</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1507"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word16Rep"><span class="hs-identifier hs-var">Word16Rep</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-1508"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word32Rep"><span class="hs-identifier hs-var">Word32Rep</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-1509"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#Word64Rep"><span class="hs-identifier hs-var">Word64Rep</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#wORD64_SIZE"><span class="hs-identifier hs-var">wORD64_SIZE</span></a></span><span>
</span><span id="line-1510"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#FloatRep"><span class="hs-identifier hs-var">FloatRep</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#fLOAT_SIZE"><span class="hs-identifier hs-var">fLOAT_SIZE</span></a></span><span>
</span><span id="line-1511"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#DoubleRep"><span class="hs-identifier hs-var">DoubleRep</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#dOUBLE_SIZE"><span class="hs-identifier hs-var">dOUBLE_SIZE</span></a></span><span>
</span><span id="line-1512"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#AddrRep"><span class="hs-identifier hs-var">AddrRep</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1513"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#LiftedRep"><span class="hs-identifier hs-var">LiftedRep</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1514"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#UnliftedRep"><span class="hs-identifier hs-var">UnliftedRep</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621680815293"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1515"></span><span>   </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#VoidRep"><span class="hs-identifier hs-var">VoidRep</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-1516"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#VecRep"><span class="hs-identifier hs-type">VecRep</span></a></span><span> </span><span id="local-6989586621680815288"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815288"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span id="local-6989586621680815287"><span class="annot"><span class="annottext">PrimElemRep
</span><a href="#local-6989586621680815287"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815288"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="#local-6989586621680815287"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-1517"></span><span>
</span><span id="line-1518"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-type">primElemRepSizeB</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimElemRep"><span class="hs-identifier hs-type">PrimElemRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-1519"></span><span id="primElemRepSizeB"><span class="annot"><span class="annottext">primElemRepSizeB :: PrimElemRep -&gt; Int
</span><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var hs-var">primElemRepSizeB</span></a></span></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Int8ElemRep"><span class="hs-identifier hs-var">Int8ElemRep</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1520"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Int16ElemRep"><span class="hs-identifier hs-var">Int16ElemRep</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-1521"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Int32ElemRep"><span class="hs-identifier hs-var">Int32ElemRep</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-1522"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Int64ElemRep"><span class="hs-identifier hs-var">Int64ElemRep</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-1523"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Word8ElemRep"><span class="hs-identifier hs-var">Word8ElemRep</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1524"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Word16ElemRep"><span class="hs-identifier hs-var">Word16ElemRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-1525"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Word32ElemRep"><span class="hs-identifier hs-var">Word32ElemRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-1526"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#Word64ElemRep"><span class="hs-identifier hs-var">Word64ElemRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-1527"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#FloatElemRep"><span class="hs-identifier hs-var">FloatElemRep</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-1528"></span><span class="annot"><a href="GHC.Core.TyCon.html#primElemRepSizeB"><span class="hs-identifier hs-var">primElemRepSizeB</span></a></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><a href="GHC.Core.TyCon.html#DoubleElemRep"><span class="hs-identifier hs-var">DoubleElemRep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-1529"></span><span>
</span><span id="line-1530"></span><span class="hs-comment">-- | Return if Rep stands for floating type,</span><span>
</span><span id="line-1531"></span><span class="hs-comment">-- returns Nothing for vector types.</span><span>
</span><span id="line-1532"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-type">primRepIsFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1533"></span><span id="primRepIsFloat"><span class="annot"><span class="annottext">primRepIsFloat :: PrimRep -&gt; Maybe Bool
</span><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var hs-var">primRepIsFloat</span></a></span></span><span>  </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#FloatRep"><span class="hs-identifier hs-var">FloatRep</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1534"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var">primRepIsFloat</span></a></span><span>  </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#DoubleRep"><span class="hs-identifier hs-var">DoubleRep</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1535"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var">primRepIsFloat</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#VecRep"><span class="hs-identifier hs-type">VecRep</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">PrimElemRep
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1536"></span><span class="annot"><a href="GHC.Core.TyCon.html#primRepIsFloat"><span class="hs-identifier hs-var">primRepIsFloat</span></a></span><span>  </span><span class="annot"><span class="annottext">PrimRep
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1537"></span><span>
</span><span id="line-1538"></span><span>
</span><span id="line-1539"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                             Field labels
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1546"></span><span>
</span><span id="line-1547"></span><span class="hs-comment">-- | The labels for the fields of this particular 'TyCon'</span><span>
</span><span id="line-1548"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFieldLabels"><span class="hs-identifier hs-type">tyConFieldLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1549"></span><span id="tyConFieldLabels"><span class="annot"><span class="annottext">tyConFieldLabels :: TyCon -&gt; [FieldLabel]
</span><a href="GHC.Core.TyCon.html#tyConFieldLabels"><span class="hs-identifier hs-var hs-var">tyConFieldLabels</span></a></span></span><span> </span><span id="local-6989586621680815285"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815285"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabelEnv -&gt; [FieldLabel]
forall a. DFastStringEnv a -&gt; [a]
</span><a href="GHC.Data.FastString.Env.html#dFsEnvElts"><span class="hs-identifier hs-var">dFsEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">(FieldLabelEnv -&gt; [FieldLabel]) -&gt; FieldLabelEnv -&gt; [FieldLabel]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#tyConFieldLabelEnv"><span class="hs-identifier hs-var">tyConFieldLabelEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815285"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1550"></span><span>
</span><span id="line-1551"></span><span class="hs-comment">-- | The labels for the fields of this particular 'TyCon'</span><span>
</span><span id="line-1552"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFieldLabelEnv"><span class="hs-identifier hs-type">tyConFieldLabelEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelEnv"><span class="hs-identifier hs-type">FieldLabelEnv</span></a></span><span>
</span><span id="line-1553"></span><span id="tyConFieldLabelEnv"><span class="annot"><span class="annottext">tyConFieldLabelEnv :: TyCon -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#tyConFieldLabelEnv"><span class="hs-identifier hs-var hs-var">tyConFieldLabelEnv</span></a></span></span><span> </span><span id="local-6989586621680815282"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815282"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-1554"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier hs-var">isAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815282"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier hs-var hs-var">algTcFields</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815282"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1555"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabelEnv
forall a. DFastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#emptyDFsEnv"><span class="hs-identifier hs-var">emptyDFsEnv</span></a></span><span>
</span><span id="line-1556"></span><span>
</span><span id="line-1557"></span><span class="hs-comment">-- | Look up a field label belonging to this 'TyCon'</span><span>
</span><span id="line-1558"></span><span class="annot"><a href="GHC.Core.TyCon.html#lookupTyConFieldLabel"><span class="hs-identifier hs-type">lookupTyConFieldLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelString"><span class="hs-identifier hs-type">FieldLabelString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span>
</span><span id="line-1559"></span><span id="lookupTyConFieldLabel"><span class="annot"><span class="annottext">lookupTyConFieldLabel :: FieldLabelString -&gt; TyCon -&gt; Maybe FieldLabel
</span><a href="GHC.Core.TyCon.html#lookupTyConFieldLabel"><span class="hs-identifier hs-var hs-var">lookupTyConFieldLabel</span></a></span></span><span> </span><span id="local-6989586621680815280"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621680815280"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621680815279"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815279"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabelEnv -&gt; FieldLabelString -&gt; Maybe FieldLabel
forall a. DFastStringEnv a -&gt; FieldLabelString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupDFsEnv"><span class="hs-identifier hs-var">lookupDFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#tyConFieldLabelEnv"><span class="hs-identifier hs-var">tyConFieldLabelEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815279"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621680815280"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-1560"></span><span>
</span><span id="line-1561"></span><span class="hs-comment">-- | Make a map from strings to FieldLabels from all the data</span><span>
</span><span id="line-1562"></span><span class="hs-comment">-- constructors of this algebraic tycon</span><span>
</span><span id="line-1563"></span><span class="annot"><a href="GHC.Core.TyCon.html#fieldsOfAlgTcRhs"><span class="hs-identifier hs-type">fieldsOfAlgTcRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelEnv"><span class="hs-identifier hs-type">FieldLabelEnv</span></a></span><span>
</span><span id="line-1564"></span><span id="fieldsOfAlgTcRhs"><span class="annot"><span class="annottext">fieldsOfAlgTcRhs :: AlgTyConRhs -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#fieldsOfAlgTcRhs"><span class="hs-identifier hs-var hs-var">fieldsOfAlgTcRhs</span></a></span></span><span> </span><span id="local-6989586621680815276"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815276"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(FieldLabelString, FieldLabel)] -&gt; FieldLabelEnv
forall a. [(FieldLabelString, a)] -&gt; DFastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#mkDFsEnv"><span class="hs-identifier hs-var">mkDFsEnv</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabel -&gt; FieldLabelString
forall a. FieldLbl a -&gt; FieldLabelString
</span><a href="GHC.Types.FieldLabel.html#flLabel"><span class="hs-identifier hs-var hs-var">flLabel</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621680815273"><span class="hs-identifier hs-var">fl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621680815273"><span class="hs-identifier hs-var">fl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1565"></span><span>                                </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621680815273"><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621680815273"><span class="hs-identifier hs-var">fl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; [FieldLabel]
forall {t :: * -&gt; *}. Foldable t =&gt; t DataCon -&gt; [FieldLabel]
</span><a href="#local-6989586621680815272"><span class="hs-identifier hs-var">dataConsFields</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#visibleDataCons"><span class="hs-identifier hs-var">visibleDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815276"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1566"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1567"></span><span>    </span><span class="hs-comment">-- Duplicates in this list will be removed by 'mkFsEnv'</span><span>
</span><span id="line-1568"></span><span>    </span><span id="local-6989586621680815272"><span class="annot"><span class="annottext">dataConsFields :: t DataCon -&gt; [FieldLabel]
</span><a href="#local-6989586621680815272"><span class="hs-identifier hs-var hs-var">dataConsFields</span></a></span></span><span> </span><span id="local-6989586621680815269"><span class="annot"><span class="annottext">t DataCon
</span><a href="#local-6989586621680815269"><span class="hs-identifier hs-var">dcs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; [FieldLabel]) -&gt; t DataCon -&gt; [FieldLabel]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [FieldLabel]
</span><a href="GHC.Core.DataCon.html#dataConFieldLabels"><span class="hs-identifier hs-var">dataConFieldLabels</span></a></span><span> </span><span class="annot"><span class="annottext">t DataCon
</span><a href="#local-6989586621680815269"><span class="hs-identifier hs-var">dcs</span></a></span><span>
</span><span id="line-1569"></span><span>
</span><span id="line-1570"></span><span>
</span><span id="line-1571"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{TyCon Construction}
*                                                                      *
************************************************************************

Note: the TyCon constructors all take a Kind as one argument, even though
they could, in principle, work out their Kind from their other arguments.
But to do so they need functions from Types, and that makes a nasty
module mutual-recursion.  And they aren't called from many places.
So we compromise, and move their Kind calculation to the call site.
-}</span><span>
</span><span id="line-1584"></span><span>
</span><span id="line-1585"></span><span class="hs-comment">-- | Given the name of the function type constructor and it's kind, create the</span><span>
</span><span id="line-1586"></span><span class="hs-comment">-- corresponding 'TyCon'. It is recommended to use 'GHC.Core.TyCo.Rep.funTyCon' if you want</span><span>
</span><span id="line-1587"></span><span class="hs-comment">-- this functionality</span><span>
</span><span id="line-1588"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkFunTyCon"><span class="hs-identifier hs-type">mkFunTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1589"></span><span id="mkFunTyCon"><span class="annot"><span class="annottext">mkFunTyCon :: Name -&gt; [TyConBinder] -&gt; Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkFunTyCon"><span class="hs-identifier hs-var hs-var">mkFunTyCon</span></a></span></span><span> </span><span id="local-6989586621680815267"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815267"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815266"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815266"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815265"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815265"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span>
</span><span id="line-1590"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FunTyCon :: Unique
-&gt; Name -&gt; [TyConBinder] -&gt; Kind -&gt; Kind -&gt; Int -&gt; Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1591"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815267"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1592"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815267"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1593"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815266"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1594"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1595"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815266"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1596"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815266"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1597"></span><span>        </span><span class="annot"><span class="annottext">tcRepName :: Name
</span><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var">tcRepName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815265"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1598"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1599"></span><span>
</span><span id="line-1600"></span><span class="hs-comment">-- | This is the making of an algebraic 'TyCon'. Notably, you have to</span><span>
</span><span id="line-1601"></span><span class="hs-comment">-- pass in the generic (in the -XGenerics sense) information about the</span><span>
</span><span id="line-1602"></span><span class="hs-comment">-- type constructor - you can get hold of it easily (see Generics</span><span>
</span><span id="line-1603"></span><span class="hs-comment">-- module)</span><span>
</span><span id="line-1604"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkAlgTyCon"><span class="hs-identifier hs-type">mkAlgTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1605"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^ Binders of the 'TyCon'</span><span>
</span><span id="line-1606"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>              </span><span class="hs-comment">-- ^ Result kind</span><span>
</span><span id="line-1607"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span>            </span><span class="hs-comment">-- ^ The roles for each TyVar</span><span>
</span><span id="line-1608"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html#CType"><span class="hs-identifier hs-type">CType</span></a></span><span>       </span><span class="hs-comment">-- ^ The C type this type corresponds to</span><span>
</span><span id="line-1609"></span><span>                                </span><span class="hs-comment">--   when using the CAPI FFI</span><span>
</span><span id="line-1610"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- ^ Stupid theta: see 'algTcStupidTheta'</span><span>
</span><span id="line-1611"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span>       </span><span class="hs-comment">-- ^ Information about data constructors</span><span>
</span><span id="line-1612"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span>      </span><span class="hs-comment">-- ^ What flavour is it?</span><span>
</span><span id="line-1613"></span><span>                                </span><span class="hs-comment">-- (e.g. vanilla, type family)</span><span>
</span><span id="line-1614"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>              </span><span class="hs-comment">-- ^ Was the 'TyCon' declared with GADT syntax?</span><span>
</span><span id="line-1615"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1616"></span><span id="mkAlgTyCon"><span class="annot"><span class="annottext">mkAlgTyCon :: Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; [Role]
-&gt; Maybe CType
-&gt; [Kind]
-&gt; AlgTyConRhs
-&gt; AlgTyConFlav
-&gt; Bool
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkAlgTyCon"><span class="hs-identifier hs-var hs-var">mkAlgTyCon</span></a></span></span><span> </span><span id="local-6989586621680815264"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815264"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815263"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815263"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815262"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815262"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815261"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815261"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815260"><span class="annot"><span class="annottext">Maybe CType
</span><a href="#local-6989586621680815260"><span class="hs-identifier hs-var">cType</span></a></span></span><span> </span><span id="local-6989586621680815259"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815259"><span class="hs-identifier hs-var">stupid</span></a></span></span><span> </span><span id="local-6989586621680815258"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815258"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621680815257"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815257"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span id="local-6989586621680815256"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815256"><span class="hs-identifier hs-var">gadt_syn</span></a></span></span><span>
</span><span id="line-1617"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; Maybe CType
-&gt; Bool
-&gt; [Kind]
-&gt; AlgTyConRhs
-&gt; FieldLabelEnv
-&gt; AlgTyConFlav
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1618"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815264"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1619"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815264"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1620"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815263"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1621"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815262"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1622"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815263"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815262"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1623"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815263"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1624"></span><span>        </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815263"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1625"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815261"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1626"></span><span>        </span><span class="annot"><span class="annottext">tyConCType :: Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier hs-var">tyConCType</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CType
</span><a href="#local-6989586621680815260"><span class="hs-identifier hs-var">cType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1627"></span><span>        </span><span class="annot"><span class="annottext">algTcStupidTheta :: [Kind]
</span><a href="GHC.Core.TyCon.html#algTcStupidTheta"><span class="hs-identifier hs-var">algTcStupidTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815259"><span class="hs-identifier hs-var">stupid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1628"></span><span>        </span><span class="annot"><span class="annottext">algTcRhs :: AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815258"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1629"></span><span>        </span><span class="annot"><span class="annottext">algTcFields :: FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier hs-var">algTcFields</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs -&gt; FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#fieldsOfAlgTcRhs"><span class="hs-identifier hs-var">fieldsOfAlgTcRhs</span></a></span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815258"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1630"></span><span>        </span><span class="annot"><span class="annottext">algTcParent :: AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">okParent</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">parent</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">parent</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">parent</span><span class="hs-special">,</span><span>
</span><span id="line-1631"></span><span>        </span><span class="annot"><span class="annottext">algTcGadtSyntax :: Bool
</span><a href="GHC.Core.TyCon.html#algTcGadtSyntax"><span class="hs-identifier hs-var">algTcGadtSyntax</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815256"><span class="hs-identifier hs-var">gadt_syn</span></a></span><span>
</span><span id="line-1632"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1633"></span><span>
</span><span id="line-1634"></span><span class="hs-comment">-- | Simpler specialization of 'mkAlgTyCon' for classes</span><span>
</span><span id="line-1635"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkClassTyCon"><span class="hs-identifier hs-type">mkClassTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1636"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span>
</span><span id="line-1637"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1638"></span><span id="mkClassTyCon"><span class="annot"><span class="annottext">mkClassTyCon :: Name
-&gt; [TyConBinder] -&gt; [Role] -&gt; AlgTyConRhs -&gt; Class -&gt; Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkClassTyCon"><span class="hs-identifier hs-var hs-var">mkClassTyCon</span></a></span></span><span> </span><span id="local-6989586621680815252"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815252"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815251"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815251"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815250"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815250"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815249"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815249"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621680815248"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815248"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span id="local-6989586621680815247"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815247"><span class="hs-identifier hs-var">tc_rep_name</span></a></span></span><span>
</span><span id="line-1639"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; [Role]
-&gt; Maybe CType
-&gt; [Kind]
-&gt; AlgTyConRhs
-&gt; AlgTyConFlav
-&gt; Bool
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkAlgTyCon"><span class="hs-identifier hs-var">mkAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815252"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815251"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.html#constraintKind"><span class="hs-identifier hs-var">constraintKind</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815250"><span class="hs-identifier hs-var">roles</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815249"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1640"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Class -&gt; Name -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-var">ClassTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815248"><span class="hs-identifier hs-var">clas</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815247"><span class="hs-identifier hs-var">tc_rep_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1641"></span><span>               </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1642"></span><span>
</span><span id="line-1643"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkTupleTyCon"><span class="hs-identifier hs-type">mkTupleTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1644"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1645"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>    </span><span class="hs-comment">-- ^ Result kind of the 'TyCon'</span><span>
</span><span id="line-1646"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>   </span><span class="hs-comment">-- ^ Arity of the tuple 'TyCon'</span><span>
</span><span id="line-1647"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-1648"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TupleSort"><span class="hs-identifier hs-type">TupleSort</span></a></span><span>    </span><span class="hs-comment">-- ^ Whether the tuple is boxed or unboxed</span><span>
</span><span id="line-1649"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span>
</span><span id="line-1650"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1651"></span><span id="mkTupleTyCon"><span class="annot"><span class="annottext">mkTupleTyCon :: Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; Int
-&gt; DataCon
-&gt; TupleSort
-&gt; AlgTyConFlav
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkTupleTyCon"><span class="hs-identifier hs-var hs-var">mkTupleTyCon</span></a></span></span><span> </span><span id="local-6989586621680815246"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815246"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815245"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815245"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815244"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815244"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815243"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815243"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621680815242"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815242"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680815241"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815241"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span id="local-6989586621680815240"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815240"><span class="hs-identifier hs-var">parent</span></a></span></span><span>
</span><span id="line-1652"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; Maybe CType
-&gt; Bool
-&gt; [Kind]
-&gt; AlgTyConRhs
-&gt; FieldLabelEnv
-&gt; AlgTyConFlav
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1653"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815246"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1654"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815246"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1655"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815245"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1656"></span><span>        </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815245"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1657"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815244"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1658"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815245"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815244"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1659"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815243"><span class="hs-identifier hs-var">arity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1660"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Role -&gt; [Role]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815243"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1661"></span><span>        </span><span class="annot"><span class="annottext">tyConCType :: Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier hs-var">tyConCType</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1662"></span><span>        </span><span class="annot"><span class="annottext">algTcGadtSyntax :: Bool
</span><a href="GHC.Core.TyCon.html#algTcGadtSyntax"><span class="hs-identifier hs-var">algTcGadtSyntax</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-1663"></span><span>        </span><span class="annot"><span class="annottext">algTcStupidTheta :: [Kind]
</span><a href="GHC.Core.TyCon.html#algTcStupidTheta"><span class="hs-identifier hs-var">algTcStupidTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-1664"></span><span>        </span><span class="annot"><span class="annottext">algTcRhs :: AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TupleTyCon :: DataCon -&gt; TupleSort -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815242"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1665"></span><span>                                        </span><span class="annot"><span class="annottext">tup_sort :: TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815241"><span class="hs-identifier hs-var">sort</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-1666"></span><span>        </span><span class="annot"><span class="annottext">algTcFields :: FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier hs-var">algTcFields</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabelEnv
forall a. DFastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#emptyDFsEnv"><span class="hs-identifier hs-var">emptyDFsEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1667"></span><span>        </span><span class="annot"><span class="annottext">algTcParent :: AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815240"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-1668"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1669"></span><span>
</span><span id="line-1670"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkSumTyCon"><span class="hs-identifier hs-type">mkSumTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1671"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1672"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>    </span><span class="hs-comment">-- ^ Kind of the resulting 'TyCon'</span><span>
</span><span id="line-1673"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>   </span><span class="hs-comment">-- ^ Arity of the sum</span><span>
</span><span id="line-1674"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ 'TyVar's scoped over: see 'tyConTyVars'</span><span>
</span><span id="line-1675"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1676"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConFlav"><span class="hs-identifier hs-type">AlgTyConFlav</span></a></span><span>
</span><span id="line-1677"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1678"></span><span id="mkSumTyCon"><span class="annot"><span class="annottext">mkSumTyCon :: Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; Int
-&gt; [TyVar]
-&gt; [DataCon]
-&gt; AlgTyConFlav
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkSumTyCon"><span class="hs-identifier hs-var hs-var">mkSumTyCon</span></a></span></span><span> </span><span id="local-6989586621680815237"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815237"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815236"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815236"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815235"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815235"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815234"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815234"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621680815233"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815233"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span id="local-6989586621680815232"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815232"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span id="local-6989586621680815231"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815231"><span class="hs-identifier hs-var">parent</span></a></span></span><span>
</span><span id="line-1679"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; Maybe CType
-&gt; Bool
-&gt; [Kind]
-&gt; AlgTyConRhs
-&gt; FieldLabelEnv
-&gt; AlgTyConFlav
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1680"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815237"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1681"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815237"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1682"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815236"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1683"></span><span>        </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815233"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1684"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815235"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1685"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815236"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815235"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1686"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815234"><span class="hs-identifier hs-var">arity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1687"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Role -&gt; [Role]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815234"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1688"></span><span>        </span><span class="annot"><span class="annottext">tyConCType :: Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier hs-var">tyConCType</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1689"></span><span>        </span><span class="annot"><span class="annottext">algTcGadtSyntax :: Bool
</span><a href="GHC.Core.TyCon.html#algTcGadtSyntax"><span class="hs-identifier hs-var">algTcGadtSyntax</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-1690"></span><span>        </span><span class="annot"><span class="annottext">algTcStupidTheta :: [Kind]
</span><a href="GHC.Core.TyCon.html#algTcStupidTheta"><span class="hs-identifier hs-var">algTcStupidTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-1691"></span><span>        </span><span class="annot"><span class="annottext">algTcRhs :: AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#mkSumTyConRhs"><span class="hs-identifier hs-var">mkSumTyConRhs</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815232"><span class="hs-identifier hs-var">cons</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1692"></span><span>        </span><span class="annot"><span class="annottext">algTcFields :: FieldLabelEnv
</span><a href="GHC.Core.TyCon.html#algTcFields"><span class="hs-identifier hs-var">algTcFields</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabelEnv
forall a. DFastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#emptyDFsEnv"><span class="hs-identifier hs-var">emptyDFsEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1693"></span><span>        </span><span class="annot"><span class="annottext">algTcParent :: AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815231"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-1694"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1695"></span><span>
</span><span id="line-1696"></span><span class="hs-comment">-- | Makes a tycon suitable for use during type-checking. It stores</span><span>
</span><span id="line-1697"></span><span class="hs-comment">-- a variety of details about the definition of the TyCon, but no</span><span>
</span><span id="line-1698"></span><span class="hs-comment">-- right-hand side. It lives only during the type-checking of a</span><span>
</span><span id="line-1699"></span><span class="hs-comment">-- mutually-recursive group of tycons; it is then zonked to a proper</span><span>
</span><span id="line-1700"></span><span class="hs-comment">-- TyCon in zonkTcTyCon.</span><span>
</span><span id="line-1701"></span><span class="hs-comment">-- See also Note [Kind checking recursive type and class declarations]</span><span>
</span><span id="line-1702"></span><span class="hs-comment">-- in &quot;GHC.Tc.TyCl&quot;.</span><span>
</span><span id="line-1703"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkTcTyCon"><span class="hs-identifier hs-type">mkTcTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-1704"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1705"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>                </span><span class="hs-comment">-- ^ /result/ kind only</span><span>
</span><span id="line-1706"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^ Scoped type variables;</span><span>
</span><span id="line-1707"></span><span>                                 </span><span class="hs-comment">-- see Note [How TcTyCons work] in GHC.Tc.TyCl</span><span>
</span><span id="line-1708"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                </span><span class="hs-comment">-- ^ Is this TcTyCon generalised already?</span><span>
</span><span id="line-1709"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span>        </span><span class="hs-comment">-- ^ What sort of 'TyCon' this represents</span><span>
</span><span id="line-1710"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1711"></span><span id="mkTcTyCon"><span class="annot"><span class="annottext">mkTcTyCon :: Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; [(Name, TyVar)]
-&gt; Bool
-&gt; TyConFlavour
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkTcTyCon"><span class="hs-identifier hs-var hs-var">mkTcTyCon</span></a></span></span><span> </span><span id="local-6989586621680815229"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815229"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815228"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815228"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815227"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815227"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815226"><span class="annot"><span class="annottext">[(Name, TyVar)]
</span><a href="#local-6989586621680815226"><span class="hs-identifier hs-var">scoped_tvs</span></a></span></span><span> </span><span id="local-6989586621680815225"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815225"><span class="hs-identifier hs-var">poly</span></a></span></span><span> </span><span id="local-6989586621680815224"><span class="annot"><span class="annottext">TyConFlavour
</span><a href="#local-6989586621680815224"><span class="hs-identifier hs-var">flav</span></a></span></span><span>
</span><span id="line-1712"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [(Name, TyVar)]
-&gt; Bool
-&gt; TyConFlavour
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815229"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1713"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815229"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1714"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815228"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1715"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815228"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1716"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815227"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-1717"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815228"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815227"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-1718"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815228"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1719"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcTyConScopedTyVars :: [(Name, TyVar)]
</span><a href="GHC.Core.TyCon.html#tcTyConScopedTyVars"><span class="hs-identifier hs-var">tcTyConScopedTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, TyVar)]
</span><a href="#local-6989586621680815226"><span class="hs-identifier hs-var">scoped_tvs</span></a></span><span>
</span><span id="line-1720"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcTyConIsPoly :: Bool
</span><a href="GHC.Core.TyCon.html#tcTyConIsPoly"><span class="hs-identifier hs-var">tcTyConIsPoly</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815225"><span class="hs-identifier hs-var">poly</span></a></span><span>
</span><span id="line-1721"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcTyConFlavour :: TyConFlavour
</span><a href="GHC.Core.TyCon.html#tcTyConFlavour"><span class="hs-identifier hs-var">tcTyConFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="#local-6989586621680815224"><span class="hs-identifier hs-var">flav</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1722"></span><span>
</span><span id="line-1723"></span><span class="hs-comment">-- | No scoped type variables (to be used with mkTcTyCon).</span><span>
</span><span id="line-1724"></span><span class="annot"><a href="GHC.Core.TyCon.html#noTcTyConScopedTyVars"><span class="hs-identifier hs-type">noTcTyConScopedTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1725"></span><span id="noTcTyConScopedTyVars"><span class="annot"><span class="annottext">noTcTyConScopedTyVars :: [(Name, TyVar)]
</span><a href="GHC.Core.TyCon.html#noTcTyConScopedTyVars"><span class="hs-identifier hs-var hs-var">noTcTyConScopedTyVars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1726"></span><span>
</span><span id="line-1727"></span><span class="hs-comment">-- | Create an unlifted primitive 'TyCon', such as @Int#@.</span><span>
</span><span id="line-1728"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkPrimTyCon"><span class="hs-identifier hs-type">mkPrimTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1729"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>   </span><span class="hs-comment">-- ^ /result/ kind, never levity-polymorphic</span><span>
</span><span id="line-1730"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1731"></span><span id="mkPrimTyCon"><span class="annot"><span class="annottext">mkPrimTyCon :: Name -&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPrimTyCon"><span class="hs-identifier hs-var hs-var">mkPrimTyCon</span></a></span></span><span> </span><span id="local-6989586621680815222"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815222"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815221"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815221"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815220"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815220"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815219"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815219"><span class="hs-identifier hs-var">roles</span></a></span></span><span>
</span><span id="line-1732"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Bool -&gt; Maybe Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPrimTyCon%27"><span class="hs-identifier hs-var">mkPrimTyCon'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815222"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815221"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815220"><span class="hs-identifier hs-var">res_kind</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815219"><span class="hs-identifier hs-var">roles</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Maybe Name) -&gt; Name -&gt; Maybe Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name
</span><a href="GHC.Core.TyCon.html#mkPrelTyConRepName"><span class="hs-identifier hs-var">mkPrelTyConRepName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815222"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1733"></span><span>
</span><span id="line-1734"></span><span class="hs-comment">-- | Kind constructors</span><span>
</span><span id="line-1735"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkKindTyCon"><span class="hs-identifier hs-type">mkKindTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1736"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>  </span><span class="hs-comment">-- ^ /result/ kind</span><span>
</span><span id="line-1737"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1738"></span><span id="mkKindTyCon"><span class="annot"><span class="annottext">mkKindTyCon :: Name -&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkKindTyCon"><span class="hs-identifier hs-var hs-var">mkKindTyCon</span></a></span></span><span> </span><span id="local-6989586621680815217"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815217"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815216"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815216"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815215"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815215"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815214"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815214"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815213"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815213"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span>
</span><span id="line-1739"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815212"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1740"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1741"></span><span>    </span><span id="local-6989586621680815212"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815212"><span class="hs-identifier hs-var hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Bool -&gt; Maybe Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPrimTyCon%27"><span class="hs-identifier hs-var">mkPrimTyCon'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815217"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815216"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815215"><span class="hs-identifier hs-var">res_kind</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815214"><span class="hs-identifier hs-var">roles</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815213"><span class="hs-identifier hs-var">rep_nm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1742"></span><span>
</span><span id="line-1743"></span><span class="hs-comment">-- | Create a lifted primitive 'TyCon' such as @RealWorld@</span><span>
</span><span id="line-1744"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkLiftedPrimTyCon"><span class="hs-identifier hs-type">mkLiftedPrimTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1745"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>   </span><span class="hs-comment">-- ^ /result/ kind</span><span>
</span><span id="line-1746"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1747"></span><span id="mkLiftedPrimTyCon"><span class="annot"><span class="annottext">mkLiftedPrimTyCon :: Name -&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkLiftedPrimTyCon"><span class="hs-identifier hs-var hs-var">mkLiftedPrimTyCon</span></a></span></span><span> </span><span id="local-6989586621680815211"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815211"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815210"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815210"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815209"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815209"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815208"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815208"><span class="hs-identifier hs-var">roles</span></a></span></span><span>
</span><span id="line-1748"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Bool -&gt; Maybe Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPrimTyCon%27"><span class="hs-identifier hs-var">mkPrimTyCon'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815211"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815210"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815209"><span class="hs-identifier hs-var">res_kind</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815208"><span class="hs-identifier hs-var">roles</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815207"><span class="hs-identifier hs-var">rep_nm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1749"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680815207"><span class="annot"><span class="annottext">rep_nm :: Name
</span><a href="#local-6989586621680815207"><span class="hs-identifier hs-var hs-var">rep_nm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name
</span><a href="GHC.Core.TyCon.html#mkPrelTyConRepName"><span class="hs-identifier hs-var">mkPrelTyConRepName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815211"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1750"></span><span>
</span><span id="line-1751"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkPrimTyCon%27"><span class="hs-identifier hs-type">mkPrimTyCon'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1752"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>    </span><span class="hs-comment">-- ^ /result/ kind, never levity-polymorphic</span><span>
</span><span id="line-1753"></span><span>                        </span><span class="hs-comment">-- (If you need a levity-polymorphic PrimTyCon, change</span><span>
</span><span id="line-1754"></span><span>                        </span><span class="hs-comment">--  isTcLevPoly.)</span><span>
</span><span id="line-1755"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1756"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1757"></span><span id="mkPrimTyCon%27"><span class="annot"><span class="annottext">mkPrimTyCon' :: Name
-&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Bool -&gt; Maybe Name -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPrimTyCon%27"><span class="hs-identifier hs-var hs-var">mkPrimTyCon'</span></a></span></span><span> </span><span id="local-6989586621680815206"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815206"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815205"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815205"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815204"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815204"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815203"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815203"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815202"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815202"><span class="hs-identifier hs-var">is_unlifted</span></a></span></span><span> </span><span id="local-6989586621680815201"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815201"><span class="hs-identifier hs-var">rep_nm</span></a></span></span><span>
</span><span id="line-1758"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; Bool
-&gt; Maybe Name
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1759"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815206"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1760"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815206"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1761"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815205"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1762"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815204"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1763"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815205"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815204"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1764"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815203"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1765"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815203"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1766"></span><span>        </span><span class="annot"><span class="annottext">isUnlifted :: Bool
</span><a href="GHC.Core.TyCon.html#isUnlifted"><span class="hs-identifier hs-var">isUnlifted</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815202"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1767"></span><span>        </span><span class="annot"><span class="annottext">primRepName :: Maybe Name
</span><a href="GHC.Core.TyCon.html#primRepName"><span class="hs-identifier hs-var">primRepName</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815201"><span class="hs-identifier hs-var">rep_nm</span></a></span><span>
</span><span id="line-1768"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1769"></span><span>
</span><span id="line-1770"></span><span class="hs-comment">-- | Create a type synonym 'TyCon'</span><span>
</span><span id="line-1771"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkSynonymTyCon"><span class="hs-identifier hs-type">mkSynonymTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>   </span><span class="hs-comment">-- ^ /result/ kind</span><span>
</span><span id="line-1772"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1773"></span><span id="mkSynonymTyCon"><span class="annot"><span class="annottext">mkSynonymTyCon :: Name
-&gt; [TyConBinder] -&gt; Kind -&gt; [Role] -&gt; Kind -&gt; Bool -&gt; Bool -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkSynonymTyCon"><span class="hs-identifier hs-var hs-var">mkSynonymTyCon</span></a></span></span><span> </span><span id="local-6989586621680815200"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815200"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815199"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815199"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815198"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815198"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815197"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815197"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815196"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815196"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621680815195"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815195"><span class="hs-identifier hs-var">is_tau</span></a></span></span><span> </span><span id="local-6989586621680815194"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815194"><span class="hs-identifier hs-var">is_fam_free</span></a></span></span><span>
</span><span id="line-1774"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SynonymTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; Kind
-&gt; Bool
-&gt; Bool
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1775"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815200"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1776"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815200"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1777"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815199"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1778"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815198"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1779"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815199"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815198"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1780"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815199"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1781"></span><span>        </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815199"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1782"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815197"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1783"></span><span>        </span><span class="annot"><span class="annottext">synTcRhs :: Kind
</span><a href="GHC.Core.TyCon.html#synTcRhs"><span class="hs-identifier hs-var">synTcRhs</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815196"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1784"></span><span>        </span><span class="annot"><span class="annottext">synIsTau :: Bool
</span><a href="GHC.Core.TyCon.html#synIsTau"><span class="hs-identifier hs-var">synIsTau</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815195"><span class="hs-identifier hs-var">is_tau</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1785"></span><span>        </span><span class="annot"><span class="annottext">synIsFamFree :: Bool
</span><a href="GHC.Core.TyCon.html#synIsFamFree"><span class="hs-identifier hs-var">synIsFamFree</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815194"><span class="hs-identifier hs-var">is_fam_free</span></a></span><span>
</span><span id="line-1786"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1787"></span><span>
</span><span id="line-1788"></span><span class="hs-comment">-- | Create a type family 'TyCon'</span><span>
</span><span id="line-1789"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkFamilyTyCon"><span class="hs-identifier hs-type">mkFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConBinder"><span class="hs-identifier hs-type">TyConBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>  </span><span class="hs-comment">-- ^ /result/ kind</span><span>
</span><span id="line-1790"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-type">FamTyConFlav</span></a></span><span>
</span><span id="line-1791"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier hs-type">Injectivity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1792"></span><span id="mkFamilyTyCon"><span class="annot"><span class="annottext">mkFamilyTyCon :: Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; Maybe Name
-&gt; FamTyConFlav
-&gt; Maybe Class
-&gt; Injectivity
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkFamilyTyCon"><span class="hs-identifier hs-var hs-var">mkFamilyTyCon</span></a></span></span><span> </span><span id="local-6989586621680815193"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815193"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815192"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815192"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815191"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815191"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815190"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815190"><span class="hs-identifier hs-var">resVar</span></a></span></span><span> </span><span id="local-6989586621680815189"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815189"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span id="local-6989586621680815188"><span class="annot"><span class="annottext">Maybe Class
</span><a href="#local-6989586621680815188"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span id="local-6989586621680815187"><span class="annot"><span class="annottext">Injectivity
</span><a href="#local-6989586621680815187"><span class="hs-identifier hs-var">inj</span></a></span></span><span>
</span><span id="line-1793"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamilyTyCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; [TyVar]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; Maybe Name
-&gt; FamTyConFlav
-&gt; Maybe TyCon
-&gt; Injectivity
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span>
</span><span id="line-1794"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815193"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1795"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815193"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1796"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815192"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1797"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815191"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-1798"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815192"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815191"><span class="hs-identifier hs-var">res_kind</span></a></span><span>
</span><span id="line-1799"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815192"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1800"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConTyVars :: [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815192"><span class="hs-identifier hs-var">binders</span></a></span><span>
</span><span id="line-1801"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">famTcResVar :: Maybe Name
</span><a href="GHC.Core.TyCon.html#famTcResVar"><span class="hs-identifier hs-var">famTcResVar</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815190"><span class="hs-identifier hs-var">resVar</span></a></span><span>
</span><span id="line-1802"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815189"><span class="hs-identifier hs-var">flav</span></a></span><span>
</span><span id="line-1803"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">famTcParent :: Maybe TyCon
</span><a href="GHC.Core.TyCon.html#famTcParent"><span class="hs-identifier hs-var">famTcParent</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; TyCon
</span><a href="GHC.Core.Class.html#classTyCon"><span class="hs-identifier hs-var hs-var">classTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">(Class -&gt; TyCon) -&gt; Maybe Class -&gt; Maybe TyCon
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Class
</span><a href="#local-6989586621680815188"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-1804"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">famTcInj :: Injectivity
</span><a href="GHC.Core.TyCon.html#famTcInj"><span class="hs-identifier hs-var">famTcInj</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Injectivity
</span><a href="#local-6989586621680815187"><span class="hs-identifier hs-var">inj</span></a></span><span>
</span><span id="line-1805"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-1806"></span><span>
</span><span id="line-1807"></span><span>
</span><span id="line-1808"></span><span class="hs-comment">-- | Create a promoted data constructor 'TyCon'</span><span>
</span><span id="line-1809"></span><span class="hs-comment">-- Somewhat dodgily, we give it the same Name</span><span>
</span><span id="line-1810"></span><span class="hs-comment">-- as the data constructor itself; when we pretty-print</span><span>
</span><span id="line-1811"></span><span class="hs-comment">-- the TyCon we add a quote; see the Outputable TyCon instance</span><span>
</span><span id="line-1812"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkPromotedDataCon"><span class="hs-identifier hs-type">mkPromotedDataCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConRepName"><span class="hs-identifier hs-type">TyConRepName</span></a></span><span>
</span><span id="line-1813"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyConTyCoBinder"><span class="hs-identifier hs-type">TyConTyCoBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1814"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRepInfo"><span class="hs-identifier hs-type">RuntimeRepInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-1815"></span><span id="mkPromotedDataCon"><span class="annot"><span class="annottext">mkPromotedDataCon :: DataCon
-&gt; Name
-&gt; Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; [Role]
-&gt; RuntimeRepInfo
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#mkPromotedDataCon"><span class="hs-identifier hs-var hs-var">mkPromotedDataCon</span></a></span></span><span> </span><span id="local-6989586621680815185"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815185"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680815184"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815184"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680815183"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815183"><span class="hs-identifier hs-var">rep_name</span></a></span></span><span> </span><span id="local-6989586621680815182"><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815182"><span class="hs-identifier hs-var">binders</span></a></span></span><span> </span><span id="local-6989586621680815181"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815181"><span class="hs-identifier hs-var">res_kind</span></a></span></span><span> </span><span id="local-6989586621680815180"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815180"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span id="local-6989586621680815179"><span class="annot"><span class="annottext">RuntimeRepInfo
</span><a href="#local-6989586621680815179"><span class="hs-identifier hs-var">rep_info</span></a></span></span><span>
</span><span id="line-1816"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PromotedDataCon :: Unique
-&gt; Name
-&gt; [TyConBinder]
-&gt; Kind
-&gt; Kind
-&gt; Int
-&gt; [Role]
-&gt; DataCon
-&gt; Name
-&gt; RuntimeRepInfo
-&gt; TyCon
</span><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1817"></span><span>        </span><span class="annot"><span class="annottext">tyConUnique :: Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815184"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1818"></span><span>        </span><span class="annot"><span class="annottext">tyConName :: Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815184"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1819"></span><span>        </span><span class="annot"><span class="annottext">tyConArity :: Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815180"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1820"></span><span>        </span><span class="annot"><span class="annottext">tcRoles :: [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815180"><span class="hs-identifier hs-var">roles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1821"></span><span>        </span><span class="annot"><span class="annottext">tyConBinders :: [TyConBinder]
</span><a href="GHC.Core.TyCon.html#tyConBinders"><span class="hs-identifier hs-var">tyConBinders</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815182"><span class="hs-identifier hs-var">binders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1822"></span><span>        </span><span class="annot"><span class="annottext">tyConResKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConResKind"><span class="hs-identifier hs-var">tyConResKind</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815181"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1823"></span><span>        </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyConBinder] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCon.html#mkTyConKind"><span class="hs-identifier hs-var">mkTyConKind</span></a></span><span> </span><span class="annot"><span class="annottext">[TyConBinder]
</span><a href="#local-6989586621680815182"><span class="hs-identifier hs-var">binders</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815181"><span class="hs-identifier hs-var">res_kind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1824"></span><span>        </span><span class="annot"><span class="annottext">dataCon :: DataCon
</span><a href="GHC.Core.TyCon.html#dataCon"><span class="hs-identifier hs-var">dataCon</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815185"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1825"></span><span>        </span><span class="annot"><span class="annottext">tcRepName :: Name
</span><a href="GHC.Core.TyCon.html#tcRepName"><span class="hs-identifier hs-var">tcRepName</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815183"><span class="hs-identifier hs-var">rep_name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1826"></span><span>        </span><span class="annot"><span class="annottext">promDcRepInfo :: RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#promDcRepInfo"><span class="hs-identifier hs-var">promDcRepInfo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuntimeRepInfo
</span><a href="#local-6989586621680815179"><span class="hs-identifier hs-var">rep_info</span></a></span><span>
</span><span id="line-1827"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-1828"></span><span>
</span><span id="line-1829"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFunTyCon"><span class="hs-identifier hs-type">isFunTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1830"></span><span id="isFunTyCon"><span class="annot"><span class="annottext">isFunTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isFunTyCon"><span class="hs-identifier hs-var hs-var">isFunTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1831"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFunTyCon"><span class="hs-identifier hs-var">isFunTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1832"></span><span>
</span><span id="line-1833"></span><span class="hs-comment">-- | Test if the 'TyCon' is algebraic but abstract (invisible data constructors)</span><span>
</span><span id="line-1834"></span><span class="annot"><a href="GHC.Core.TyCon.html#isAbstractTyCon"><span class="hs-identifier hs-type">isAbstractTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1835"></span><span id="isAbstractTyCon"><span class="annot"><span class="annottext">isAbstractTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isAbstractTyCon"><span class="hs-identifier hs-var hs-var">isAbstractTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-var">AbstractTyCon</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1836"></span><span class="annot"><a href="GHC.Core.TyCon.html#isAbstractTyCon"><span class="hs-identifier hs-var">isAbstractTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1837"></span><span>
</span><span id="line-1838"></span><span class="hs-comment">-- | Does this 'TyCon' represent something that cannot be defined in Haskell?</span><span>
</span><span id="line-1839"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPrimTyCon"><span class="hs-identifier hs-type">isPrimTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1840"></span><span id="isPrimTyCon"><span class="annot"><span class="annottext">isPrimTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isPrimTyCon"><span class="hs-identifier hs-var hs-var">isPrimTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1841"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPrimTyCon"><span class="hs-identifier hs-var">isPrimTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1842"></span><span>
</span><span id="line-1843"></span><span class="hs-comment">-- | Is this 'TyCon' unlifted (i.e. cannot contain bottom)? Note that this can</span><span>
</span><span id="line-1844"></span><span class="hs-comment">-- only be true for primitive and unboxed-tuple 'TyCon's</span><span>
</span><span id="line-1845"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier hs-type">isUnliftedTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1846"></span><span id="isUnliftedTyCon"><span class="annot"><span class="annottext">isUnliftedTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier hs-var hs-var">isUnliftedTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span>  </span><span class="hs-special">{</span><span class="annot"><span class="annottext">isUnlifted :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnlifted"><span class="hs-identifier hs-var">isUnlifted</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815178"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815178"><span class="hs-identifier hs-var">is_unlifted</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1847"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815178"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span>
</span><span id="line-1848"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier hs-var">isUnliftedTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815177"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815177"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1849"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815176"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815176"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815177"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1850"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Bool
</span><a href="GHC.Types.Basic.html#isBoxed"><span class="hs-identifier hs-var">isBoxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TupleSort -&gt; Boxity
</span><a href="GHC.Types.Basic.html#tupleSortBoxity"><span class="hs-identifier hs-var">tupleSortBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815176"><span class="hs-identifier hs-var">sort</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1851"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier hs-var">isUnliftedTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815173"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815173"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1852"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815173"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1853"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1854"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnliftedTyCon"><span class="hs-identifier hs-var">isUnliftedTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1855"></span><span>
</span><span id="line-1856"></span><span class="hs-comment">-- | Returns @True@ if the supplied 'TyCon' resulted from either a</span><span>
</span><span id="line-1857"></span><span class="hs-comment">-- @data@ or @newtype@ declaration</span><span>
</span><span id="line-1858"></span><span class="annot"><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier hs-type">isAlgTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1859"></span><span id="isAlgTyCon"><span class="annot"><span class="annottext">isAlgTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier hs-var hs-var">isAlgTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1860"></span><span class="annot"><a href="GHC.Core.TyCon.html#isAlgTyCon"><span class="hs-identifier hs-var">isAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1861"></span><span>
</span><span id="line-1862"></span><span class="hs-comment">-- | Returns @True@ for vanilla AlgTyCons -- that is, those created</span><span>
</span><span id="line-1863"></span><span class="hs-comment">-- with a @data@ or @newtype@ declaration.</span><span>
</span><span id="line-1864"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVanillaAlgTyCon"><span class="hs-identifier hs-type">isVanillaAlgTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1865"></span><span id="isVanillaAlgTyCon"><span class="annot"><span class="annottext">isVanillaAlgTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isVanillaAlgTyCon"><span class="hs-identifier hs-var hs-var">isVanillaAlgTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#VanillaAlgTyCon"><span class="hs-identifier hs-type">VanillaAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1866"></span><span class="annot"><a href="GHC.Core.TyCon.html#isVanillaAlgTyCon"><span class="hs-identifier hs-var">isVanillaAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1867"></span><span>
</span><span id="line-1868"></span><span class="hs-comment">-- | Returns @True@ for the 'TyCon' of the 'Constraint' kind.</span><span>
</span><span id="line-1869"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isConstraintKindCon"><span class="hs-pragma hs-type">isConstraintKindCon</span></a></span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-comment">-- See Note [Inlining coreView] in GHC.Core.Type</span><span>
</span><span id="line-1870"></span><span class="annot"><a href="GHC.Core.TyCon.html#isConstraintKindCon"><span class="hs-identifier hs-type">isConstraintKindCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1871"></span><span class="hs-comment">-- NB: We intentionally match on AlgTyCon, because 'constraintKindTyCon' is</span><span>
</span><span id="line-1872"></span><span class="hs-comment">-- always an AlgTyCon (see 'pcTyCon' in TysWiredIn) and the record selector</span><span>
</span><span id="line-1873"></span><span class="hs-comment">-- for 'tyConUnique' would generate unreachable code for every other data</span><span>
</span><span id="line-1874"></span><span class="hs-comment">-- constructor of TyCon (see #18026).</span><span>
</span><span id="line-1875"></span><span id="isConstraintKindCon"><span class="annot"><span class="annottext">isConstraintKindCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isConstraintKindCon"><span class="hs-identifier hs-var hs-var">isConstraintKindCon</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConUnique :: TyCon -&gt; Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var">tyConUnique</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815172"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680815172"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680815172"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#constraintKindTyConKey"><span class="hs-identifier hs-var">constraintKindTyConKey</span></a></span><span>
</span><span id="line-1876"></span><span class="annot"><a href="GHC.Core.TyCon.html#isConstraintKindCon"><span class="hs-identifier hs-var">isConstraintKindCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1877"></span><span>
</span><span id="line-1878"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier hs-type">isDataTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1879"></span><span class="hs-comment">-- ^ Returns @True@ for data types that are /definitely/ represented by</span><span>
</span><span id="line-1880"></span><span class="hs-comment">-- heap-allocated constructors.  These are scrutinised by Core-level</span><span>
</span><span id="line-1881"></span><span class="hs-comment">-- @case@ expressions, and they get info tables allocated for them.</span><span>
</span><span id="line-1882"></span><span class="hs-comment">--</span><span>
</span><span id="line-1883"></span><span class="hs-comment">-- Generally, the function will be true for all @data@ types and false</span><span>
</span><span id="line-1884"></span><span class="hs-comment">-- for @newtype@s, unboxed tuples, unboxed sums and type family</span><span>
</span><span id="line-1885"></span><span class="hs-comment">-- 'TyCon's. But it is not guaranteed to return @True@ in all cases</span><span>
</span><span id="line-1886"></span><span class="hs-comment">-- that it could.</span><span>
</span><span id="line-1887"></span><span class="hs-comment">--</span><span>
</span><span id="line-1888"></span><span class="hs-comment">-- NB: for a data type family, only the /instance/ 'TyCon's</span><span>
</span><span id="line-1889"></span><span class="hs-comment">--     get an info table.  The family declaration 'TyCon' does not</span><span>
</span><span id="line-1890"></span><span id="isDataTyCon"><span class="annot"><span class="annottext">isDataTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier hs-var hs-var">isDataTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815170"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815170"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1891"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815170"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1892"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815169"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815169"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1893"></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Boxity -&gt; Bool
</span><a href="GHC.Types.Basic.html#isBoxed"><span class="hs-identifier hs-var">isBoxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TupleSort -&gt; Boxity
</span><a href="GHC.Types.Basic.html#tupleSortBoxity"><span class="hs-identifier hs-var">tupleSortBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815169"><span class="hs-identifier hs-var">sort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1894"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1895"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1896"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1897"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-type">AbstractTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>      </span><span class="hs-comment">-- We don't know, so return False</span><span>
</span><span id="line-1898"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataTyCon"><span class="hs-identifier hs-var">isDataTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1899"></span><span>
</span><span id="line-1900"></span><span class="hs-comment">-- | 'isInjectiveTyCon' is true of 'TyCon's for which this property holds</span><span>
</span><span id="line-1901"></span><span class="hs-comment">-- (where X is the role passed in):</span><span>
</span><span id="line-1902"></span><span class="hs-comment">--   If (T a1 b1 c1) ~X (T a2 b2 c2), then (a1 ~X1 a2), (b1 ~X2 b2), and (c1 ~X3 c2)</span><span>
</span><span id="line-1903"></span><span class="hs-comment">-- (where X1, X2, and X3, are the roles given by tyConRolesX tc X)</span><span>
</span><span id="line-1904"></span><span class="hs-comment">-- See also Note [Decomposing equality] in &quot;GHC.Tc.Solver.Canonical&quot;</span><span>
</span><span id="line-1905"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-type">isInjectiveTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1906"></span><span id="isInjectiveTyCon"><span class="annot"><span class="annottext">isInjectiveTyCon :: TyCon -&gt; Role -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var hs-var">isInjectiveTyCon</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                             </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Phantom"><span class="hs-identifier hs-var">Phantom</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1907"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                 </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1908"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                 </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1909"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815166"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815166"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span>
</span><span id="line-1910"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var">isGenInjAlgRhs</span></a></span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815166"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1911"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>             </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1912"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1913"></span><span>                                               </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1914"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcInj :: TyCon -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#famTcInj"><span class="hs-identifier hs-var">famTcInj</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-type">Injective</span></a></span><span> </span><span id="local-6989586621680815165"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680815165"><span class="hs-identifier hs-var">inj</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#and"><span class="hs-identifier hs-var">and</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680815165"><span class="hs-identifier hs-var">inj</span></a></span><span>
</span><span id="line-1915"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>              </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1916"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1917"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1918"></span><span class="annot"><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                  </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1919"></span><span>  </span><span class="hs-comment">-- Reply True for TcTyCon to minimise knock on type errors</span><span>
</span><span id="line-1920"></span><span>  </span><span class="hs-comment">-- See Note [How TcTyCons work] item (1) in GHC.Tc.TyCl</span><span>
</span><span id="line-1921"></span><span>
</span><span id="line-1922"></span><span class="hs-comment">-- | 'isGenerativeTyCon' is true of 'TyCon's for which this property holds</span><span>
</span><span id="line-1923"></span><span class="hs-comment">-- (where X is the role passed in):</span><span>
</span><span id="line-1924"></span><span class="hs-comment">--   If (T tys ~X t), then (t's head ~X T).</span><span>
</span><span id="line-1925"></span><span class="hs-comment">-- See also Note [Decomposing equality] in &quot;GHC.Tc.Solver.Canonical&quot;</span><span>
</span><span id="line-1926"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenerativeTyCon"><span class="hs-identifier hs-type">isGenerativeTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1927"></span><span id="isGenerativeTyCon"><span class="annot"><span class="annottext">isGenerativeTyCon :: TyCon -&gt; Role -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGenerativeTyCon"><span class="hs-identifier hs-var hs-var">isGenerativeTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1928"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenerativeTyCon"><span class="hs-identifier hs-var">isGenerativeTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1929"></span><span>  </span><span class="hs-comment">-- in all other cases, injectivity implies generativity</span><span>
</span><span id="line-1930"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenerativeTyCon"><span class="hs-identifier hs-var">isGenerativeTyCon</span></a></span><span> </span><span id="local-6989586621680815164"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815164"><span class="hs-identifier hs-var">tc</span></a></span></span><span>               </span><span id="local-6989586621680815163"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680815163"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Role -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815164"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621680815163"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1931"></span><span>
</span><span id="line-1932"></span><span class="hs-comment">-- | Is this an 'AlgTyConRhs' of a 'TyCon' that is generative and injective</span><span>
</span><span id="line-1933"></span><span class="hs-comment">-- with respect to representational equality?</span><span>
</span><span id="line-1934"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-type">isGenInjAlgRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1935"></span><span id="isGenInjAlgRhs"><span class="annot"><span class="annottext">isGenInjAlgRhs :: AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var hs-var">isGenInjAlgRhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1936"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var">isGenInjAlgRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1937"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var">isGenInjAlgRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1938"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var">isGenInjAlgRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-type">AbstractTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1939"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGenInjAlgRhs"><span class="hs-identifier hs-var">isGenInjAlgRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1940"></span><span>
</span><span id="line-1941"></span><span class="hs-comment">-- | Is this 'TyCon' that for a @newtype@</span><span>
</span><span id="line-1942"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-type">isNewTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1943"></span><span id="isNewTyCon"><span class="annot"><span class="annottext">isNewTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-var hs-var">isNewTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1944"></span><span class="annot"><a href="GHC.Core.TyCon.html#isNewTyCon"><span class="hs-identifier hs-var">isNewTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1945"></span><span>
</span><span id="line-1946"></span><span class="hs-comment">-- | Take a 'TyCon' apart into the 'TyVar's it scopes over, the 'Type' it</span><span>
</span><span id="line-1947"></span><span class="hs-comment">-- expands into, and (possibly) a coercion from the representation type to the</span><span>
</span><span id="line-1948"></span><span class="hs-comment">-- @newtype@.</span><span>
</span><span id="line-1949"></span><span class="hs-comment">-- Returns @Nothing@ if this is not possible.</span><span>
</span><span id="line-1950"></span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyCon_maybe"><span class="hs-identifier hs-type">unwrapNewTyCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1951"></span><span id="unwrapNewTyCon_maybe"><span class="annot"><span class="annottext">unwrapNewTyCon_maybe :: TyCon -&gt; Maybe ([TyVar], Kind, CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#unwrapNewTyCon_maybe"><span class="hs-identifier hs-var hs-var">unwrapNewTyCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815162"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815162"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-1952"></span><span>                                 </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_co :: AlgTyConRhs -&gt; CoAxiom Unbranched
</span><a href="GHC.Core.TyCon.html#nt_co"><span class="hs-identifier hs-var">nt_co</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815161"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815161"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-1953"></span><span>                                                       </span><span class="annot"><span class="annottext">nt_rhs :: AlgTyConRhs -&gt; Kind
</span><a href="GHC.Core.TyCon.html#nt_rhs"><span class="hs-identifier hs-var">nt_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815160"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815160"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1954"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([TyVar], Kind, CoAxiom Unbranched)
-&gt; Maybe ([TyVar], Kind, CoAxiom Unbranched)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815162"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815160"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815161"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1955"></span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyCon_maybe"><span class="hs-identifier hs-var">unwrapNewTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([TyVar], Kind, CoAxiom Unbranched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1956"></span><span>
</span><span id="line-1957"></span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyConEtad_maybe"><span class="hs-identifier hs-type">unwrapNewTyConEtad_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1958"></span><span id="unwrapNewTyConEtad_maybe"><span class="annot"><span class="annottext">unwrapNewTyConEtad_maybe :: TyCon -&gt; Maybe ([TyVar], Kind, CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#unwrapNewTyConEtad_maybe"><span class="hs-identifier hs-var hs-var">unwrapNewTyConEtad_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_co :: AlgTyConRhs -&gt; CoAxiom Unbranched
</span><a href="GHC.Core.TyCon.html#nt_co"><span class="hs-identifier hs-var">nt_co</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815159"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815159"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-1959"></span><span>                                                           </span><span class="annot"><span class="annottext">nt_etad_rhs :: AlgTyConRhs -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#nt_etad_rhs"><span class="hs-identifier hs-var">nt_etad_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680815158"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815158"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680815157"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815157"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1960"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([TyVar], Kind, CoAxiom Unbranched)
-&gt; Maybe ([TyVar], Kind, CoAxiom Unbranched)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815158"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815157"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815159"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1961"></span><span class="annot"><a href="GHC.Core.TyCon.html#unwrapNewTyConEtad_maybe"><span class="hs-identifier hs-var">unwrapNewTyConEtad_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([TyVar], Kind, CoAxiom Unbranched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1962"></span><span>
</span><span id="line-1963"></span><span class="annot"><a href="GHC.Core.TyCon.html#isProductTyCon"><span class="hs-identifier hs-type">isProductTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1964"></span><span class="hs-comment">-- True of datatypes or newtypes that have</span><span>
</span><span id="line-1965"></span><span class="hs-comment">--   one, non-existential, data constructor</span><span>
</span><span id="line-1966"></span><span class="hs-comment">-- See Note [Product types]</span><span>
</span><span id="line-1967"></span><span id="isProductTyCon"><span class="annot"><span class="annottext">isProductTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isProductTyCon"><span class="hs-identifier hs-var hs-var">isProductTyCon</span></a></span></span><span> </span><span id="local-6989586621680815156"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815156"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1968"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var hs-var">algTcRhs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815156"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1969"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1970"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680815155"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815155"><span class="hs-identifier hs-var">data_con</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1971"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier hs-var">dataConExTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815155"><span class="hs-identifier hs-var">data_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1972"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1973"></span><span>      </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1974"></span><span class="annot"><a href="GHC.Core.TyCon.html#isProductTyCon"><span class="hs-identifier hs-var">isProductTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1975"></span><span>
</span><span id="line-1976"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataProductTyCon_maybe"><span class="hs-identifier hs-type">isDataProductTyCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-1977"></span><span class="hs-comment">-- True of datatypes (not newtypes) with</span><span>
</span><span id="line-1978"></span><span class="hs-comment">--   one, vanilla, data constructor</span><span>
</span><span id="line-1979"></span><span class="hs-comment">-- See Note [Product types]</span><span>
</span><span id="line-1980"></span><span id="isDataProductTyCon_maybe"><span class="annot"><span class="annottext">isDataProductTyCon_maybe :: TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#isDataProductTyCon_maybe"><span class="hs-identifier hs-var hs-var">isDataProductTyCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815154"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815154"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1981"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815154"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1982"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680815153"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815153"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1983"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier hs-var">dataConExTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815153"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- non-existential</span><span>
</span><span id="line-1984"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815153"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-1985"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815152"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815152"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1986"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815152"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-1987"></span><span>       </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1988"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataProductTyCon_maybe"><span class="hs-identifier hs-var">isDataProductTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1989"></span><span>
</span><span id="line-1990"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataSumTyCon_maybe"><span class="hs-identifier hs-type">isDataSumTyCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1991"></span><span id="isDataSumTyCon_maybe"><span class="annot"><span class="annottext">isDataSumTyCon_maybe :: TyCon -&gt; Maybe [DataCon]
</span><a href="GHC.Core.TyCon.html#isDataSumTyCon_maybe"><span class="hs-identifier hs-var hs-var">isDataSumTyCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815151"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815151"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1992"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815151"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1993"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815150"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815150"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1994"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815150"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthExceeds"><span class="hs-operator hs-var">`lengthExceeds`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1995"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; Bool) -&gt; [DataCon] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([TyVar] -&gt; Bool) -&gt; (DataCon -&gt; [TyVar]) -&gt; DataCon -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier hs-var">dataConExTyCoVars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815150"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="hs-comment">-- FIXME(osa): Why do we need this?</span><span>
</span><span id="line-1996"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815150"><span class="hs-identifier hs-var">cons</span></a></span><span>
</span><span id="line-1997"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815148"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815148"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1998"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; Bool) -&gt; [DataCon] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([TyVar] -&gt; Bool) -&gt; (DataCon -&gt; [TyVar]) -&gt; DataCon -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [TyVar]
</span><a href="GHC.Core.DataCon.html#dataConExTyCoVars"><span class="hs-identifier hs-var">dataConExTyCoVars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815148"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="hs-comment">-- FIXME(osa): Why do we need this?</span><span>
</span><span id="line-1999"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815148"><span class="hs-identifier hs-var">cons</span></a></span><span>
</span><span id="line-2000"></span><span>      </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [DataCon]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2001"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataSumTyCon_maybe"><span class="hs-identifier hs-var">isDataSumTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [DataCon]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2002"></span><span>
</span><span id="line-2003"></span><span class="hs-comment">{- Note [Product types]
~~~~~~~~~~~~~~~~~~~~~~~
A product type is
 * A data type (not a newtype)
 * With one, boxed data constructor
 * That binds no existential type variables

The main point is that product types are amenable to unboxing for
  * Strict function calls; we can transform
        f (D a b) = e
    to
        fw a b = e
    via the worker/wrapper transformation.  (Question: couldn't this
    work for existentials too?)

  * CPR for function results; we can transform
        f x y = let ... in D a b
    to
        fw x y = let ... in (# a, b #)

Note that the data constructor /can/ have evidence arguments: equality
constraints, type classes etc.  So it can be GADT.  These evidence
arguments are simply value arguments, and should not get in the way.
-}</span><span>
</span><span id="line-2027"></span><span>
</span><span id="line-2028"></span><span>
</span><span id="line-2029"></span><span class="hs-comment">-- | Is this a 'TyCon' representing a regular H98 type synonym (@type@)?</span><span>
</span><span id="line-2030"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-pragma hs-type">isTypeSynonymTyCon</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- See Note [Inlining coreView] in GHC.Core.Type</span><span>
</span><span id="line-2031"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-identifier hs-type">isTypeSynonymTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2032"></span><span id="isTypeSynonymTyCon"><span class="annot"><span class="annottext">isTypeSynonymTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-identifier hs-var hs-var">isTypeSynonymTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2033"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeSynonymTyCon"><span class="hs-identifier hs-var">isTypeSynonymTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2034"></span><span>
</span><span id="line-2035"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTauTyCon"><span class="hs-identifier hs-type">isTauTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2036"></span><span id="isTauTyCon"><span class="annot"><span class="annottext">isTauTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTauTyCon"><span class="hs-identifier hs-var hs-var">isTauTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">synIsTau :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#synIsTau"><span class="hs-identifier hs-var">synIsTau</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815147"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815147"><span class="hs-identifier hs-var">is_tau</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815147"><span class="hs-identifier hs-var">is_tau</span></a></span><span>
</span><span id="line-2037"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTauTyCon"><span class="hs-identifier hs-var">isTauTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2038"></span><span>
</span><span id="line-2039"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamFreeTyCon"><span class="hs-identifier hs-type">isFamFreeTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2040"></span><span id="isFamFreeTyCon"><span class="annot"><span class="annottext">isFamFreeTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isFamFreeTyCon"><span class="hs-identifier hs-var hs-var">isFamFreeTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">synIsFamFree :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#synIsFamFree"><span class="hs-identifier hs-var">synIsFamFree</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815146"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815146"><span class="hs-identifier hs-var">fam_free</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815146"><span class="hs-identifier hs-var">fam_free</span></a></span><span>
</span><span id="line-2041"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamFreeTyCon"><span class="hs-identifier hs-var">isFamFreeTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815145"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815145"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-var">isDataFamFlav</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815145"><span class="hs-identifier hs-var">flav</span></a></span><span>
</span><span id="line-2042"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamFreeTyCon"><span class="hs-identifier hs-var">isFamFreeTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2043"></span><span>
</span><span id="line-2044"></span><span class="hs-comment">-- As for newtypes, it is in some contexts important to distinguish between</span><span>
</span><span id="line-2045"></span><span class="hs-comment">-- closed synonyms and synonym families, as synonym families have no unique</span><span>
</span><span id="line-2046"></span><span class="hs-comment">-- right hand side to which a synonym family application can expand.</span><span>
</span><span id="line-2047"></span><span class="hs-comment">--</span><span>
</span><span id="line-2048"></span><span>
</span><span id="line-2049"></span><span class="hs-comment">-- | True iff we can decompose (T a b c) into ((T a b) c)</span><span>
</span><span id="line-2050"></span><span class="hs-comment">--   I.e. is it injective and generative w.r.t nominal equality?</span><span>
</span><span id="line-2051"></span><span class="hs-comment">--   That is, if (T a b) ~N d e f, is it always the case that</span><span>
</span><span id="line-2052"></span><span class="hs-comment">--            (T ~N d), (a ~N e) and (b ~N f)?</span><span>
</span><span id="line-2053"></span><span class="hs-comment">-- Specifically NOT true of synonyms (open and otherwise)</span><span>
</span><span id="line-2054"></span><span class="hs-comment">--</span><span>
</span><span id="line-2055"></span><span class="hs-comment">-- It'd be unusual to call mustBeSaturated on a regular H98</span><span>
</span><span id="line-2056"></span><span class="hs-comment">-- type synonym, because you should probably have expanded it first</span><span>
</span><span id="line-2057"></span><span class="hs-comment">-- But regardless, it's not decomposable</span><span>
</span><span id="line-2058"></span><span class="annot"><a href="GHC.Core.TyCon.html#mustBeSaturated"><span class="hs-identifier hs-type">mustBeSaturated</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2059"></span><span id="mustBeSaturated"><span class="annot"><span class="annottext">mustBeSaturated :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#mustBeSaturated"><span class="hs-identifier hs-var hs-var">mustBeSaturated</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour -&gt; Bool
</span><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">(TyConFlavour -&gt; Bool) -&gt; (TyCon -&gt; TyConFlavour) -&gt; TyCon -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span>
</span><span id="line-2060"></span><span>
</span><span id="line-2061"></span><span class="hs-comment">-- | Is this an algebraic 'TyCon' declared with the GADT syntax?</span><span>
</span><span id="line-2062"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGadtSyntaxTyCon"><span class="hs-identifier hs-type">isGadtSyntaxTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2063"></span><span id="isGadtSyntaxTyCon"><span class="annot"><span class="annottext">isGadtSyntaxTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isGadtSyntaxTyCon"><span class="hs-identifier hs-var hs-var">isGadtSyntaxTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcGadtSyntax :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#algTcGadtSyntax"><span class="hs-identifier hs-var">algTcGadtSyntax</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815142"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815142"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815142"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-2064"></span><span class="annot"><a href="GHC.Core.TyCon.html#isGadtSyntaxTyCon"><span class="hs-identifier hs-var">isGadtSyntaxTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2065"></span><span>
</span><span id="line-2066"></span><span class="hs-comment">-- | Is this an algebraic 'TyCon' which is just an enumeration of values?</span><span>
</span><span id="line-2067"></span><span class="annot"><a href="GHC.Core.TyCon.html#isEnumerationTyCon"><span class="hs-identifier hs-type">isEnumerationTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2068"></span><span class="hs-comment">-- See Note [Enumeration types] in GHC.Core.TyCon</span><span>
</span><span id="line-2069"></span><span id="isEnumerationTyCon"><span class="annot"><span class="annottext">isEnumerationTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isEnumerationTyCon"><span class="hs-identifier hs-var hs-var">isEnumerationTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConArity :: TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815141"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815141"><span class="hs-identifier hs-var">arity</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815140"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815140"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2070"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815140"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2071"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">is_enum :: AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#is_enum"><span class="hs-identifier hs-var">is_enum</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815139"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815139"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815139"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-2072"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815141"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-2073"></span><span>       </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2074"></span><span class="annot"><a href="GHC.Core.TyCon.html#isEnumerationTyCon"><span class="hs-identifier hs-var">isEnumerationTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2075"></span><span>
</span><span id="line-2076"></span><span class="hs-comment">-- | Is this a 'TyCon', synonym or otherwise, that defines a family?</span><span>
</span><span id="line-2077"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamilyTyCon"><span class="hs-identifier hs-type">isFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2078"></span><span id="isFamilyTyCon"><span class="annot"><span class="annottext">isFamilyTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isFamilyTyCon"><span class="hs-identifier hs-var hs-var">isFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2079"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamilyTyCon"><span class="hs-identifier hs-var">isFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2080"></span><span>
</span><span id="line-2081"></span><span class="hs-comment">-- | Is this a 'TyCon', synonym or otherwise, that defines a family with</span><span>
</span><span id="line-2082"></span><span class="hs-comment">-- instances?</span><span>
</span><span id="line-2083"></span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenFamilyTyCon"><span class="hs-identifier hs-type">isOpenFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2084"></span><span id="isOpenFamilyTyCon"><span class="annot"><span class="annottext">isOpenFamilyTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isOpenFamilyTyCon"><span class="hs-identifier hs-var hs-var">isOpenFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815138"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815138"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2085"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#OpenSynFamilyTyCon"><span class="hs-identifier hs-var">OpenSynFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815138"><span class="hs-identifier hs-var">flav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2086"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815138"><span class="hs-identifier hs-var">flav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2087"></span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenFamilyTyCon"><span class="hs-identifier hs-var">isOpenFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2088"></span><span>
</span><span id="line-2089"></span><span class="hs-comment">-- | Is this a synonym 'TyCon' that can have may have further instances appear?</span><span>
</span><span id="line-2090"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier hs-type">isTypeFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2091"></span><span id="isTypeFamilyTyCon"><span class="annot"><span class="annottext">isTypeFamilyTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier hs-var hs-var">isTypeFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815137"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815137"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FamTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-var">isDataFamFlav</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815137"><span class="hs-identifier hs-var">flav</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2092"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier hs-var">isTypeFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2093"></span><span>
</span><span id="line-2094"></span><span class="hs-comment">-- | Is this a synonym 'TyCon' that can have may have further instances appear?</span><span>
</span><span id="line-2095"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataFamilyTyCon"><span class="hs-identifier hs-type">isDataFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2096"></span><span id="isDataFamilyTyCon"><span class="annot"><span class="annottext">isDataFamilyTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataFamilyTyCon"><span class="hs-identifier hs-var hs-var">isDataFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815136"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815136"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-var">isDataFamFlav</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815136"><span class="hs-identifier hs-var">flav</span></a></span><span>
</span><span id="line-2097"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataFamilyTyCon"><span class="hs-identifier hs-var">isDataFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2098"></span><span>
</span><span id="line-2099"></span><span class="hs-comment">-- | Is this an open type family TyCon?</span><span>
</span><span id="line-2100"></span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenTypeFamilyTyCon"><span class="hs-identifier hs-type">isOpenTypeFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2101"></span><span id="isOpenTypeFamilyTyCon"><span class="annot"><span class="annottext">isOpenTypeFamilyTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isOpenTypeFamilyTyCon"><span class="hs-identifier hs-var hs-var">isOpenTypeFamilyTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#OpenSynFamilyTyCon"><span class="hs-identifier hs-var">OpenSynFamilyTyCon</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2102"></span><span class="annot"><a href="GHC.Core.TyCon.html#isOpenTypeFamilyTyCon"><span class="hs-identifier hs-var">isOpenTypeFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2103"></span><span>
</span><span id="line-2104"></span><span class="hs-comment">-- | Is this a non-empty closed type family? Returns 'Nothing' for</span><span>
</span><span id="line-2105"></span><span class="hs-comment">-- abstract or empty closed families.</span><span>
</span><span id="line-2106"></span><span class="annot"><a href="GHC.Core.TyCon.html#isClosedSynFamilyTyConWithAxiom_maybe"><span class="hs-identifier hs-type">isClosedSynFamilyTyConWithAxiom_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Branched"><span class="hs-identifier hs-type">Branched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2107"></span><span id="isClosedSynFamilyTyConWithAxiom_maybe"><span class="annot"><span class="annottext">isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -&gt; Maybe (CoAxiom Branched)
</span><a href="GHC.Core.TyCon.html#isClosedSynFamilyTyConWithAxiom_maybe"><span class="hs-identifier hs-var hs-var">isClosedSynFamilyTyConWithAxiom_maybe</span></a></span></span><span>
</span><span id="line-2108"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClosedSynFamilyTyCon"><span class="hs-identifier hs-type">ClosedSynFamilyTyCon</span></a></span><span> </span><span id="local-6989586621680815135"><span class="annot"><span class="annottext">Maybe (CoAxiom Branched)
</span><a href="#local-6989586621680815135"><span class="hs-identifier hs-var">mb</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CoAxiom Branched)
</span><a href="#local-6989586621680815135"><span class="hs-identifier hs-var">mb</span></a></span><span>
</span><span id="line-2109"></span><span class="annot"><a href="GHC.Core.TyCon.html#isClosedSynFamilyTyConWithAxiom_maybe"><span class="hs-identifier hs-var">isClosedSynFamilyTyConWithAxiom_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CoAxiom Branched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2110"></span><span>
</span><span id="line-2111"></span><span class="hs-comment">-- | @'tyConInjectivityInfo' tc@ returns @'Injective' is@ is @tc@ is an</span><span>
</span><span id="line-2112"></span><span class="hs-comment">-- injective tycon (where @is@ states for which 'tyConBinders' @tc@ is</span><span>
</span><span id="line-2113"></span><span class="hs-comment">-- injective), or 'NotInjective' otherwise.</span><span>
</span><span id="line-2114"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConInjectivityInfo"><span class="hs-identifier hs-type">tyConInjectivityInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier hs-type">Injectivity</span></a></span><span>
</span><span id="line-2115"></span><span id="tyConInjectivityInfo"><span class="annot"><span class="annottext">tyConInjectivityInfo :: TyCon -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#tyConInjectivityInfo"><span class="hs-identifier hs-var hs-var">tyConInjectivityInfo</span></a></span></span><span> </span><span id="local-6989586621680815134"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815134"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-2116"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcInj :: TyCon -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#famTcInj"><span class="hs-identifier hs-var">famTcInj</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815133"><span class="annot"><span class="annottext">Injectivity
</span><a href="#local-6989586621680815133"><span class="hs-identifier hs-var">inj</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815134"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-2117"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Injectivity
</span><a href="#local-6989586621680815133"><span class="hs-identifier hs-var">inj</span></a></span><span>
</span><span id="line-2118"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Role -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isInjectiveTyCon"><span class="hs-identifier hs-var">isInjectiveTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815134"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span>
</span><span id="line-2119"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-var">Injective</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; [Bool]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var hs-var">tyConArity</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815134"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-2120"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-2121"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Injectivity
</span><a href="GHC.Core.TyCon.html#NotInjective"><span class="hs-identifier hs-var">NotInjective</span></a></span><span>
</span><span id="line-2122"></span><span>
</span><span id="line-2123"></span><span class="annot"><a href="GHC.Core.TyCon.html#isBuiltInSynFamTyCon_maybe"><span class="hs-identifier hs-type">isBuiltInSynFamTyCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#BuiltInSynFamily"><span class="hs-identifier hs-type">BuiltInSynFamily</span></a></span><span>
</span><span id="line-2124"></span><span id="isBuiltInSynFamTyCon_maybe"><span class="annot"><span class="annottext">isBuiltInSynFamTyCon_maybe :: TyCon -&gt; Maybe BuiltInSynFamily
</span><a href="GHC.Core.TyCon.html#isBuiltInSynFamTyCon_maybe"><span class="hs-identifier hs-var hs-var">isBuiltInSynFamTyCon_maybe</span></a></span></span><span>
</span><span id="line-2125"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#BuiltInSynFamTyCon"><span class="hs-identifier hs-type">BuiltInSynFamTyCon</span></a></span><span> </span><span id="local-6989586621680815132"><span class="annot"><span class="annottext">BuiltInSynFamily
</span><a href="#local-6989586621680815132"><span class="hs-identifier hs-var">ops</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuiltInSynFamily -&gt; Maybe BuiltInSynFamily
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BuiltInSynFamily
</span><a href="#local-6989586621680815132"><span class="hs-identifier hs-var">ops</span></a></span><span>
</span><span id="line-2126"></span><span class="annot"><a href="GHC.Core.TyCon.html#isBuiltInSynFamTyCon_maybe"><span class="hs-identifier hs-var">isBuiltInSynFamTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BuiltInSynFamily
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2127"></span><span>
</span><span id="line-2128"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-type">isDataFamFlav</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-type">FamTyConFlav</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2129"></span><span id="isDataFamFlav"><span class="annot"><span class="annottext">isDataFamFlav :: FamTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-var hs-var">isDataFamFlav</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>   </span><span class="hs-comment">-- Data family</span><span>
</span><span id="line-2130"></span><span class="annot"><a href="GHC.Core.TyCon.html#isDataFamFlav"><span class="hs-identifier hs-var">isDataFamFlav</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>  </span><span class="hs-comment">-- Type synonym family</span><span>
</span><span id="line-2131"></span><span>
</span><span id="line-2132"></span><span class="hs-comment">-- | Is this TyCon for an associated type?</span><span>
</span><span id="line-2133"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConAssoc"><span class="hs-identifier hs-type">isTyConAssoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2134"></span><span id="isTyConAssoc"><span class="annot"><span class="annottext">isTyConAssoc :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTyConAssoc"><span class="hs-identifier hs-var hs-var">isTyConAssoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe TyCon -&gt; Bool) -&gt; (TyCon -&gt; Maybe TyCon) -&gt; TyCon -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#tyConAssoc_maybe"><span class="hs-identifier hs-var">tyConAssoc_maybe</span></a></span><span>
</span><span id="line-2135"></span><span>
</span><span id="line-2136"></span><span class="hs-comment">-- | Get the enclosing class TyCon (if there is one) for the given TyCon.</span><span>
</span><span id="line-2137"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConAssoc_maybe"><span class="hs-identifier hs-type">tyConAssoc_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-2138"></span><span id="tyConAssoc_maybe"><span class="annot"><span class="annottext">tyConAssoc_maybe :: TyCon -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#tyConAssoc_maybe"><span class="hs-identifier hs-var hs-var">tyConAssoc_maybe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier hs-var">tyConFlavourAssoc_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">(TyConFlavour -&gt; Maybe TyCon)
-&gt; (TyCon -&gt; TyConFlavour) -&gt; TyCon -&gt; Maybe TyCon
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span>
</span><span id="line-2139"></span><span>
</span><span id="line-2140"></span><span class="hs-comment">-- | Get the enclosing class TyCon (if there is one) for the given TyConFlavour</span><span>
</span><span id="line-2141"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier hs-type">tyConFlavourAssoc_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-2142"></span><span id="tyConFlavourAssoc_maybe"><span class="annot"><span class="annottext">tyConFlavourAssoc_maybe :: TyConFlavour -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier hs-var hs-var">tyConFlavourAssoc_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-type">DataFamilyFlavour</span></a></span><span> </span><span id="local-6989586621680815129"><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815129"><span class="hs-identifier hs-var">mb_parent</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815129"><span class="hs-identifier hs-var">mb_parent</span></a></span><span>
</span><span id="line-2143"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier hs-var">tyConFlavourAssoc_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-type">OpenTypeFamilyFlavour</span></a></span><span> </span><span id="local-6989586621680815127"><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815127"><span class="hs-identifier hs-var">mb_parent</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815127"><span class="hs-identifier hs-var">mb_parent</span></a></span><span>
</span><span id="line-2144"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavourAssoc_maybe"><span class="hs-identifier hs-var">tyConFlavourAssoc_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><span class="hs-identifier">_</span></span><span>                                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2145"></span><span>
</span><span id="line-2146"></span><span class="hs-comment">-- The unit tycon didn't used to be classed as a tuple tycon</span><span>
</span><span id="line-2147"></span><span class="hs-comment">-- but I thought that was silly so I've undone it</span><span>
</span><span id="line-2148"></span><span class="hs-comment">-- If it can't be for some reason, it should be a AlgTyCon</span><span>
</span><span id="line-2149"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTupleTyCon"><span class="hs-identifier hs-type">isTupleTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2150"></span><span class="hs-comment">-- ^ Does this 'TyCon' represent a tuple?</span><span>
</span><span id="line-2151"></span><span class="hs-comment">--</span><span>
</span><span id="line-2152"></span><span class="hs-comment">-- NB: when compiling @Data.Tuple@, the tycons won't reply @True@ to</span><span>
</span><span id="line-2153"></span><span class="hs-comment">-- 'isTupleTyCon', because they are built as 'AlgTyCons'.  However they</span><span>
</span><span id="line-2154"></span><span class="hs-comment">-- get spat into the interface file as tuple tycons, so I don't think</span><span>
</span><span id="line-2155"></span><span class="hs-comment">-- it matters.</span><span>
</span><span id="line-2156"></span><span id="isTupleTyCon"><span class="annot"><span class="annottext">isTupleTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTupleTyCon"><span class="hs-identifier hs-var hs-var">isTupleTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2157"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTupleTyCon"><span class="hs-identifier hs-var">isTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2158"></span><span>
</span><span id="line-2159"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConTuple_maybe"><span class="hs-identifier hs-type">tyConTuple_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TupleSort"><span class="hs-identifier hs-type">TupleSort</span></a></span><span>
</span><span id="line-2160"></span><span id="tyConTuple_maybe"><span class="annot"><span class="annottext">tyConTuple_maybe :: TyCon -&gt; Maybe TupleSort
</span><a href="GHC.Core.TyCon.html#tyConTuple_maybe"><span class="hs-identifier hs-var hs-var">tyConTuple_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815126"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815126"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2161"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815125"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815125"><span class="hs-identifier hs-var">sort</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815126"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TupleSort -&gt; Maybe TupleSort
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815125"><span class="hs-identifier hs-var">sort</span></a></span><span>
</span><span id="line-2162"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConTuple_maybe"><span class="hs-identifier hs-var">tyConTuple_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TupleSort
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2163"></span><span>
</span><span id="line-2164"></span><span class="hs-comment">-- | Is this the 'TyCon' for an unboxed tuple?</span><span>
</span><span id="line-2165"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier hs-type">isUnboxedTupleTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2166"></span><span id="isUnboxedTupleTyCon"><span class="annot"><span class="annottext">isUnboxedTupleTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier hs-var hs-var">isUnboxedTupleTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815124"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815124"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2167"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815123"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815123"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815124"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2168"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Bool
</span><a href="GHC.Types.Basic.html#isBoxed"><span class="hs-identifier hs-var">isBoxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TupleSort -&gt; Boxity
</span><a href="GHC.Types.Basic.html#tupleSortBoxity"><span class="hs-identifier hs-var">tupleSortBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815123"><span class="hs-identifier hs-var">sort</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2169"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedTupleTyCon"><span class="hs-identifier hs-var">isUnboxedTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2170"></span><span>
</span><span id="line-2171"></span><span class="hs-comment">-- | Is this the 'TyCon' for a boxed tuple?</span><span>
</span><span id="line-2172"></span><span class="annot"><a href="GHC.Core.TyCon.html#isBoxedTupleTyCon"><span class="hs-identifier hs-type">isBoxedTupleTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2173"></span><span id="isBoxedTupleTyCon"><span class="annot"><span class="annottext">isBoxedTupleTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isBoxedTupleTyCon"><span class="hs-identifier hs-var hs-var">isBoxedTupleTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815122"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815122"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2174"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815121"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815121"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815122"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2175"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Boxity -&gt; Bool
</span><a href="GHC.Types.Basic.html#isBoxed"><span class="hs-identifier hs-var">isBoxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TupleSort -&gt; Boxity
</span><a href="GHC.Types.Basic.html#tupleSortBoxity"><span class="hs-identifier hs-var">tupleSortBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680815121"><span class="hs-identifier hs-var">sort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2176"></span><span class="annot"><a href="GHC.Core.TyCon.html#isBoxedTupleTyCon"><span class="hs-identifier hs-var">isBoxedTupleTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2177"></span><span>
</span><span id="line-2178"></span><span class="hs-comment">-- | Is this the 'TyCon' for an unboxed sum?</span><span>
</span><span id="line-2179"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedSumTyCon"><span class="hs-identifier hs-type">isUnboxedSumTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2180"></span><span id="isUnboxedSumTyCon"><span class="annot"><span class="annottext">isUnboxedSumTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isUnboxedSumTyCon"><span class="hs-identifier hs-var hs-var">isUnboxedSumTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815120"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815120"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2181"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815120"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2182"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2183"></span><span class="annot"><a href="GHC.Core.TyCon.html#isUnboxedSumTyCon"><span class="hs-identifier hs-var">isUnboxedSumTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2184"></span><span>
</span><span id="line-2185"></span><span class="hs-comment">-- | Is this the 'TyCon' for a /promoted/ tuple?</span><span>
</span><span id="line-2186"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedTupleTyCon"><span class="hs-identifier hs-type">isPromotedTupleTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2187"></span><span id="isPromotedTupleTyCon"><span class="annot"><span class="annottext">isPromotedTupleTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isPromotedTupleTyCon"><span class="hs-identifier hs-var hs-var">isPromotedTupleTyCon</span></a></span></span><span> </span><span id="local-6989586621680815119"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815119"><span class="hs-identifier hs-var">tyCon</span></a></span></span><span>
</span><span id="line-2188"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680815118"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815118"><span class="hs-identifier hs-var">dataCon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#isPromotedDataCon_maybe"><span class="hs-identifier hs-var">isPromotedDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815119"><span class="hs-identifier hs-var">tyCon</span></a></span><span>
</span><span id="line-2189"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTupleTyCon"><span class="hs-identifier hs-var">isTupleTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; TyCon
</span><a href="GHC.Core.DataCon.html#dataConTyCon"><span class="hs-identifier hs-var">dataConTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815118"><span class="hs-identifier hs-var">dataCon</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2190"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2191"></span><span>
</span><span id="line-2192"></span><span class="hs-comment">-- | Is this a PromotedDataCon?</span><span>
</span><span id="line-2193"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon"><span class="hs-identifier hs-type">isPromotedDataCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2194"></span><span id="isPromotedDataCon"><span class="annot"><span class="annottext">isPromotedDataCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isPromotedDataCon"><span class="hs-identifier hs-var hs-var">isPromotedDataCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2195"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon"><span class="hs-identifier hs-var">isPromotedDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2196"></span><span>
</span><span id="line-2197"></span><span class="hs-comment">-- | Retrieves the promoted DataCon if this is a PromotedDataCon;</span><span>
</span><span id="line-2198"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon_maybe"><span class="hs-identifier hs-type">isPromotedDataCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-2199"></span><span id="isPromotedDataCon_maybe"><span class="annot"><span class="annottext">isPromotedDataCon_maybe :: TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#isPromotedDataCon_maybe"><span class="hs-identifier hs-var hs-var">isPromotedDataCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">dataCon :: TyCon -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#dataCon"><span class="hs-identifier hs-var">dataCon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815117"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815117"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815117"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-2200"></span><span class="annot"><a href="GHC.Core.TyCon.html#isPromotedDataCon_maybe"><span class="hs-identifier hs-var">isPromotedDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2201"></span><span>
</span><span id="line-2202"></span><span class="hs-comment">-- | Is this tycon really meant for use at the kind level? That is,</span><span>
</span><span id="line-2203"></span><span class="hs-comment">-- should it be permitted without -XDataKinds?</span><span>
</span><span id="line-2204"></span><span class="annot"><a href="GHC.Core.TyCon.html#isKindTyCon"><span class="hs-identifier hs-type">isKindTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2205"></span><span id="isKindTyCon"><span class="annot"><span class="annottext">isKindTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isKindTyCon"><span class="hs-identifier hs-var hs-var">isKindTyCon</span></a></span></span><span> </span><span id="local-6989586621680815116"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815116"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815116"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; UniqSet Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; UniqSet a -&gt; Bool
</span><a href="GHC.Types.Unique.Set.html#elementOfUniqSet"><span class="hs-operator hs-var">`elementOfUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet Unique
</span><a href="GHC.Core.TyCon.html#kindTyConKeys"><span class="hs-identifier hs-var">kindTyConKeys</span></a></span><span>
</span><span id="line-2206"></span><span>
</span><span id="line-2207"></span><span class="hs-comment">-- | These TyCons should be allowed at the kind level, even without</span><span>
</span><span id="line-2208"></span><span class="hs-comment">-- -XDataKinds.</span><span>
</span><span id="line-2209"></span><span class="annot"><a href="GHC.Core.TyCon.html#kindTyConKeys"><span class="hs-identifier hs-type">kindTyConKeys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-2210"></span><span id="kindTyConKeys"><span class="annot"><span class="annottext">kindTyConKeys :: UniqSet Unique
</span><a href="GHC.Core.TyCon.html#kindTyConKeys"><span class="hs-identifier hs-var hs-var">kindTyConKeys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UniqSet Unique] -&gt; UniqSet Unique
forall a. [UniqSet a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#unionManyUniqSets"><span class="hs-identifier hs-var">unionManyUniqSets</span></a></span><span>
</span><span id="line-2211"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[Unique] -&gt; UniqSet Unique
forall a. Uniquable a =&gt; [a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#mkUniqSet"><span class="hs-identifier hs-var">mkUniqSet</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#liftedTypeKindTyConKey"><span class="hs-identifier hs-var">liftedTypeKindTyConKey</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#constraintKindTyConKey"><span class="hs-identifier hs-var">constraintKindTyConKey</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#tYPETyConKey"><span class="hs-identifier hs-var">tYPETyConKey</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-2212"></span><span>  </span><span class="annot"><span class="annottext">UniqSet Unique -&gt; [UniqSet Unique] -&gt; [UniqSet Unique]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(TyCon -&gt; UniqSet Unique) -&gt; [TyCon] -&gt; [UniqSet Unique]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Unique] -&gt; UniqSet Unique
forall a. Uniquable a =&gt; [a] -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#mkUniqSet"><span class="hs-identifier hs-var">mkUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">([Unique] -&gt; UniqSet Unique)
-&gt; (TyCon -&gt; [Unique]) -&gt; TyCon -&gt; UniqSet Unique
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Unique]
</span><a href="#local-6989586621680815109"><span class="hs-identifier hs-var">tycon_with_datacons</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#runtimeRepTyCon"><span class="hs-identifier hs-var">runtimeRepTyCon</span></a></span><span>
</span><span id="line-2213"></span><span>                                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#multiplicityTyCon"><span class="hs-identifier hs-var">multiplicityTyCon</span></a></span><span>
</span><span id="line-2214"></span><span>                                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#vecCountTyCon"><span class="hs-identifier hs-var">vecCountTyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#vecElemTyCon"><span class="hs-identifier hs-var">vecElemTyCon</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-2215"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-2216"></span><span>    </span><span id="local-6989586621680815109"><span class="annot"><span class="annottext">tycon_with_datacons :: TyCon -&gt; [Unique]
</span><a href="#local-6989586621680815109"><span class="hs-identifier hs-var hs-var">tycon_with_datacons</span></a></span></span><span> </span><span id="local-6989586621680815105"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815105"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815105"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; [Unique] -&gt; [Unique]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; Unique) -&gt; [DataCon] -&gt; [Unique]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815105"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2217"></span><span>
</span><span id="line-2218"></span><span class="annot"><a href="GHC.Core.TyCon.html#isLiftedTypeKindTyConName"><span class="hs-identifier hs-type">isLiftedTypeKindTyConName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2219"></span><span id="isLiftedTypeKindTyConName"><span class="annot"><span class="annottext">isLiftedTypeKindTyConName :: Name -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isLiftedTypeKindTyConName"><span class="hs-identifier hs-var hs-var">isLiftedTypeKindTyConName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#liftedTypeKindTyConKey"><span class="hs-identifier hs-var">liftedTypeKindTyConKey</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2220"></span><span>
</span><span id="line-2221"></span><span class="hs-comment">-- | Identifies implicit tycons that, in particular, do not go into interface</span><span>
</span><span id="line-2222"></span><span class="hs-comment">-- files (because they are implicitly reconstructed when the interface is</span><span>
</span><span id="line-2223"></span><span class="hs-comment">-- read).</span><span>
</span><span id="line-2224"></span><span class="hs-comment">--</span><span>
</span><span id="line-2225"></span><span class="hs-comment">-- Note that:</span><span>
</span><span id="line-2226"></span><span class="hs-comment">--</span><span>
</span><span id="line-2227"></span><span class="hs-comment">-- * Associated families are implicit, as they are re-constructed from</span><span>
</span><span id="line-2228"></span><span class="hs-comment">--   the class declaration in which they reside, and</span><span>
</span><span id="line-2229"></span><span class="hs-comment">--</span><span>
</span><span id="line-2230"></span><span class="hs-comment">-- * Family instances are /not/ implicit as they represent the instance body</span><span>
</span><span id="line-2231"></span><span class="hs-comment">--   (similar to a @dfun@ does that for a class instance).</span><span>
</span><span id="line-2232"></span><span class="hs-comment">--</span><span>
</span><span id="line-2233"></span><span class="hs-comment">-- * Tuples are implicit iff they have a wired-in name</span><span>
</span><span id="line-2234"></span><span class="hs-comment">--   (namely: boxed and unboxed tuples are wired-in and implicit,</span><span>
</span><span id="line-2235"></span><span class="hs-comment">--            but constraint tuples are not)</span><span>
</span><span id="line-2236"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-type">isImplicitTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2237"></span><span id="isImplicitTyCon"><span class="annot"><span class="annottext">isImplicitTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var hs-var">isImplicitTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2238"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2239"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2240"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815103"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815103"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConName :: TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var">tyConName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815102"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815102"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2241"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815103"><span class="hs-identifier hs-var">rhs</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isWiredInName"><span class="hs-identifier hs-var">isWiredInName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680815102"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-2242"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815103"><span class="hs-identifier hs-var">rhs</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2243"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2244"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcParent :: TyCon -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#famTcParent"><span class="hs-identifier hs-var">famTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815100"><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815100"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680815100"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-2245"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2246"></span><span class="annot"><a href="GHC.Core.TyCon.html#isImplicitTyCon"><span class="hs-identifier hs-var">isImplicitTyCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2247"></span><span>
</span><span id="line-2248"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConCType_maybe"><span class="hs-identifier hs-type">tyConCType_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html#CType"><span class="hs-identifier hs-type">CType</span></a></span><span>
</span><span id="line-2249"></span><span id="tyConCType_maybe"><span class="annot"><span class="annottext">tyConCType_maybe :: TyCon -&gt; Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType_maybe"><span class="hs-identifier hs-var hs-var">tyConCType_maybe</span></a></span></span><span> </span><span id="local-6989586621680815099"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815099"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe CType
</span><a href="GHC.Core.TyCon.html#tyConCType"><span class="hs-identifier hs-var hs-var">tyConCType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815099"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-2250"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConCType_maybe"><span class="hs-identifier hs-var">tyConCType_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2251"></span><span>
</span><span id="line-2252"></span><span class="hs-comment">-- | Is this a TcTyCon? (That is, one only used during type-checking?)</span><span>
</span><span id="line-2253"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcTyCon"><span class="hs-identifier hs-type">isTcTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2254"></span><span id="isTcTyCon"><span class="annot"><span class="annottext">isTcTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTcTyCon"><span class="hs-identifier hs-var hs-var">isTcTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2255"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcTyCon"><span class="hs-identifier hs-var">isTcTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2256"></span><span>
</span><span id="line-2257"></span><span class="annot"><a href="GHC.Core.TyCon.html#setTcTyConKind"><span class="hs-identifier hs-type">setTcTyConKind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-2258"></span><span class="hs-comment">-- Update the Kind of a TcTyCon</span><span>
</span><span id="line-2259"></span><span class="hs-comment">-- The new kind is always a zonked version of its previous</span><span>
</span><span id="line-2260"></span><span class="hs-comment">-- kind, so we don't need to update any other fields.</span><span>
</span><span id="line-2261"></span><span class="hs-comment">-- See Note [The Purely Kinded Invariant] in GHC.Tc.Gen.HsType</span><span>
</span><span id="line-2262"></span><span id="setTcTyConKind"><span class="annot"><span class="annottext">setTcTyConKind :: TyCon -&gt; Kind -&gt; TyCon
</span><a href="GHC.Core.TyCon.html#setTcTyConKind"><span class="hs-identifier hs-var hs-var">setTcTyConKind</span></a></span></span><span> </span><span id="local-6989586621680815098"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815098"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621680815097"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815097"><span class="hs-identifier hs-var">kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815098"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConKind :: Kind
</span><a href="GHC.Core.TyCon.html#tyConKind"><span class="hs-identifier hs-var">tyConKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815097"><span class="hs-identifier hs-var">kind</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-2263"></span><span class="annot"><a href="GHC.Core.TyCon.html#setTcTyConKind"><span class="hs-identifier hs-var">setTcTyConKind</span></a></span><span> </span><span id="local-6989586621680815096"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815096"><span class="hs-identifier hs-var">tc</span></a></span></span><span>              </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TyCon
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;setTcTyConKind&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815096"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2264"></span><span>
</span><span id="line-2265"></span><span class="hs-comment">-- | Could this TyCon ever be levity-polymorphic when fully applied?</span><span>
</span><span id="line-2266"></span><span class="hs-comment">-- True is safe. False means we're sure. Does only a quick check</span><span>
</span><span id="line-2267"></span><span class="hs-comment">-- based on the TyCon's category.</span><span>
</span><span id="line-2268"></span><span class="hs-comment">-- Precondition: The fully-applied TyCon has kind (TYPE blah)</span><span>
</span><span id="line-2269"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-type">isTcLevPoly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2270"></span><span id="isTcLevPoly"><span class="annot"><span class="annottext">isTcLevPoly :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var hs-var">isTcLevPoly</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2271"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815094"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815094"><span class="hs-identifier hs-var">parent</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815093"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815093"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2272"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#UnboxedAlgTyCon"><span class="hs-identifier hs-type">UnboxedAlgTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815094"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-2273"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2274"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_lev_poly :: AlgTyConRhs -&gt; Bool
</span><a href="GHC.Core.TyCon.html#nt_lev_poly"><span class="hs-identifier hs-var">nt_lev_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815092"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815092"><span class="hs-identifier hs-var">lev_poly</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815093"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2275"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815092"><span class="hs-identifier hs-var">lev_poly</span></a></span><span> </span><span class="hs-comment">-- Newtypes can be levity polymorphic with UnliftedNewtypes (#17360)</span><span>
</span><span id="line-2276"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-2277"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2278"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2279"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2280"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2281"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2282"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTcLevPoly"><span class="hs-identifier hs-var">isTcLevPoly</span></a></span><span> </span><span id="local-6989586621680815091"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815091"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;isTcLevPoly datacon&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815091"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2283"></span><span>
</span><span id="line-2284"></span><span class="hs-comment">{-
-----------------------------------------------
--      Expand type-constructor applications
-----------------------------------------------
-}</span><span>
</span><span id="line-2289"></span><span>
</span><span id="line-2290"></span><span id="local-6989586621680816004"><span class="annot"><a href="GHC.Core.TyCon.html#expandSynTyCon_maybe"><span class="hs-identifier hs-type">expandSynTyCon_maybe</span></a></span><span>
</span><span id="line-2291"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-2292"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680816004"><span class="hs-identifier hs-type">tyco</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- ^ Arguments to 'TyCon'</span><span>
</span><span id="line-2293"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680816004"><span class="hs-identifier hs-type">tyco</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-2294"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-2295"></span><span>                  </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680816004"><span class="hs-identifier hs-type">tyco</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>         </span><span class="hs-comment">-- ^ Returns a 'TyVar' substitution, the body</span><span>
</span><span id="line-2296"></span><span>                                  </span><span class="hs-comment">-- type of the synonym (not yet substituted)</span><span>
</span><span id="line-2297"></span><span>                                  </span><span class="hs-comment">-- and any arguments remaining from the</span><span>
</span><span id="line-2298"></span><span>                                  </span><span class="hs-comment">-- application</span><span>
</span><span id="line-2299"></span><span>
</span><span id="line-2300"></span><span class="hs-comment">-- ^ Expand a type synonym application, if any</span><span>
</span><span id="line-2301"></span><span id="expandSynTyCon_maybe"><span class="annot"><span class="annottext">expandSynTyCon_maybe :: forall tyco.
TyCon -&gt; [tyco] -&gt; Maybe ([(TyVar, tyco)], Kind, [tyco])
</span><a href="GHC.Core.TyCon.html#expandSynTyCon_maybe"><span class="hs-identifier hs-var hs-var">expandSynTyCon_maybe</span></a></span></span><span> </span><span id="local-6989586621680815090"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815090"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680815089"><span class="annot"><span class="annottext">[tyco]
</span><a href="#local-6989586621680815089"><span class="hs-identifier hs-var">tys</span></a></span></span><span>
</span><span id="line-2302"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tyConTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815088"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815088"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">synTcRhs :: TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#synTcRhs"><span class="hs-identifier hs-var">synTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815087"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815087"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tyConArity :: TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var">tyConArity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815086"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815086"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815090"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-2303"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[tyco]
</span><a href="#local-6989586621680815089"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">[tyco] -&gt; Int -&gt; Ordering
forall a. [a] -&gt; Int -&gt; Ordering
</span><a href="GHC.Utils.Misc.html#listLengthCmp"><span class="hs-operator hs-var">`listLengthCmp`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815086"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2304"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([(TyVar, tyco)], Kind, [tyco])
-&gt; Maybe ([(TyVar, tyco)], Kind, [tyco])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815088"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [tyco] -&gt; [(TyVar, tyco)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[tyco]
</span><a href="#local-6989586621680815089"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815087"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [tyco] -&gt; [tyco]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#drop"><span class="hs-identifier hs-var">drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815086"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">[tyco]
</span><a href="#local-6989586621680815089"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2305"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([(TyVar, tyco)], Kind, [tyco])
-&gt; Maybe ([(TyVar, tyco)], Kind, [tyco])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815088"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; [tyco] -&gt; [(TyVar, tyco)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[tyco]
</span><a href="#local-6989586621680815089"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815087"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-2306"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ([(TyVar, tyco)], Kind, [tyco])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2307"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-2308"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([(TyVar, tyco)], Kind, [tyco])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2309"></span><span>
</span><span id="line-2310"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-2311"></span><span>
</span><span id="line-2312"></span><span class="hs-comment">-- | Check if the tycon actually refers to a proper `data` or `newtype`</span><span>
</span><span id="line-2313"></span><span class="hs-comment">--  with user defined constructors rather than one from a class or other</span><span>
</span><span id="line-2314"></span><span class="hs-comment">--  construction.</span><span>
</span><span id="line-2315"></span><span>
</span><span id="line-2316"></span><span class="hs-comment">-- NB: This is only used in GHC.Tc.Gen.Export.checkPatSynParent to determine if an</span><span>
</span><span id="line-2317"></span><span class="hs-comment">-- exported tycon can have a pattern synonym bundled with it, e.g.,</span><span>
</span><span id="line-2318"></span><span class="hs-comment">-- module Foo (TyCon(.., PatSyn)) where</span><span>
</span><span id="line-2319"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier hs-type">isTyConWithSrcDataCons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2320"></span><span id="isTyConWithSrcDataCons"><span class="annot"><span class="annottext">isTyConWithSrcDataCons :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier hs-var hs-var">isTyConWithSrcDataCons</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815083"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815083"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815082"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815082"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2321"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815083"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2322"></span><span>    </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815081"><span class="hs-identifier hs-var">isSrcParent</span></a></span><span>
</span><span id="line-2323"></span><span>    </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815081"><span class="hs-identifier hs-var">isSrcParent</span></a></span><span>
</span><span id="line-2324"></span><span>    </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680815081"><span class="hs-identifier hs-var">isSrcParent</span></a></span><span>
</span><span id="line-2325"></span><span>    </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2326"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-2327"></span><span>    </span><span id="local-6989586621680815081"><span class="annot"><span class="annottext">isSrcParent :: Bool
</span><a href="#local-6989586621680815081"><span class="hs-identifier hs-var hs-var">isSrcParent</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isNoParent"><span class="hs-identifier hs-var">isNoParent</span></a></span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680815082"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-2328"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier hs-var">isTyConWithSrcDataCons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2329"></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-comment">-- #14058</span><span>
</span><span id="line-2330"></span><span class="annot"><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier hs-var">isTyConWithSrcDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2331"></span><span>
</span><span id="line-2332"></span><span>
</span><span id="line-2333"></span><span class="hs-comment">-- | As 'tyConDataCons_maybe', but returns the empty list of constructors if no</span><span>
</span><span id="line-2334"></span><span class="hs-comment">-- constructors could be found</span><span>
</span><span id="line-2335"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-type">tyConDataCons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2336"></span><span class="hs-comment">-- It's convenient for tyConDataCons to return the</span><span>
</span><span id="line-2337"></span><span class="hs-comment">-- empty list for type synonyms etc</span><span>
</span><span id="line-2338"></span><span id="tyConDataCons"><span class="annot"><span class="annottext">tyConDataCons :: TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var hs-var">tyConDataCons</span></a></span></span><span> </span><span id="local-6989586621680815080"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815080"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier hs-var">tyConDataCons_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815080"><span class="hs-identifier hs-var">tycon</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [DataCon] -&gt; [DataCon] -&gt; [DataCon]
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-2339"></span><span>
</span><span id="line-2340"></span><span class="hs-comment">-- | Determine the 'DataCon's originating from the given 'TyCon', if the 'TyCon'</span><span>
</span><span id="line-2341"></span><span class="hs-comment">-- is the sort that can have any constructors (note: this does not include</span><span>
</span><span id="line-2342"></span><span class="hs-comment">-- abstract algebraic types)</span><span>
</span><span id="line-2343"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier hs-type">tyConDataCons_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2344"></span><span id="tyConDataCons_maybe"><span class="annot"><span class="annottext">tyConDataCons_maybe :: TyCon -&gt; Maybe [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier hs-var hs-var">tyConDataCons_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815078"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815078"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2345"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815078"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2346"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815077"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815077"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815077"><span class="hs-identifier hs-var">cons</span></a></span><span>
</span><span id="line-2347"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815076"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815076"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815076"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2348"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815075"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815075"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815075"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2349"></span><span>       </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815074"><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815074"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DataCon] -&gt; Maybe [DataCon]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[DataCon]
</span><a href="#local-6989586621680815074"><span class="hs-identifier hs-var">cons</span></a></span><span>
</span><span id="line-2350"></span><span>       </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>                              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [DataCon]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2351"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons_maybe"><span class="hs-identifier hs-var">tyConDataCons_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [DataCon]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2352"></span><span>
</span><span id="line-2353"></span><span class="hs-comment">-- | If the given 'TyCon' has a /single/ data constructor, i.e. it is a @data@</span><span>
</span><span id="line-2354"></span><span class="hs-comment">-- type with one alternative, a tuple type or a @newtype@ then that constructor</span><span>
</span><span id="line-2355"></span><span class="hs-comment">-- is returned. If the 'TyCon' has more than one constructor, or represents a</span><span>
</span><span id="line-2356"></span><span class="hs-comment">-- primitive or function type constructor then @Nothing@ is returned. In any</span><span>
</span><span id="line-2357"></span><span class="hs-comment">-- other case, the function panics</span><span>
</span><span id="line-2358"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-type">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-2359"></span><span id="tyConSingleDataCon_maybe"><span class="annot"><span class="annottext">tyConSingleDataCon_maybe :: TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var hs-var">tyConSingleDataCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815073"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815073"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2360"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815073"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2361"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680815072"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815072"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815072"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2362"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815071"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815071"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815071"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2363"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815070"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815070"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815070"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2364"></span><span>      </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2365"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2366"></span><span>
</span><span id="line-2367"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleDataCon"><span class="hs-identifier hs-type">tyConSingleDataCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-2368"></span><span id="tyConSingleDataCon"><span class="annot"><span class="annottext">tyConSingleDataCon :: TyCon -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon"><span class="hs-identifier hs-var hs-var">tyConSingleDataCon</span></a></span></span><span> </span><span id="local-6989586621680815069"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815069"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-2369"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815069"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2370"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680815068"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815068"><span class="hs-identifier hs-var">c</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815068"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2371"></span><span>      </span><span class="annot"><span class="annottext">Maybe DataCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DataCon
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConDataCon&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815069"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2372"></span><span>
</span><span id="line-2373"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleAlgDataCon_maybe"><span class="hs-identifier hs-type">tyConSingleAlgDataCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-2374"></span><span class="hs-comment">-- Returns (Just con) for single-constructor</span><span>
</span><span id="line-2375"></span><span class="hs-comment">-- *algebraic* data types *not* newtypes</span><span>
</span><span id="line-2376"></span><span id="tyConSingleAlgDataCon_maybe"><span class="annot"><span class="annottext">tyConSingleAlgDataCon_maybe :: TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleAlgDataCon_maybe"><span class="hs-identifier hs-var hs-var">tyConSingleAlgDataCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815067"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815067"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2377"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815067"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2378"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons :: AlgTyConRhs -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#data_cons"><span class="hs-identifier hs-var">data_cons</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680815066"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815066"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815066"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2379"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815065"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815065"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815065"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-2380"></span><span>      </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2381"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSingleAlgDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleAlgDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2382"></span><span>
</span><span id="line-2383"></span><span class="hs-comment">-- | Determine the number of value constructors a 'TyCon' has. Panics if the</span><span>
</span><span id="line-2384"></span><span class="hs-comment">-- 'TyCon' is not algebraic or a tuple</span><span>
</span><span id="line-2385"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier hs-type">tyConFamilySize</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-2386"></span><span id="tyConFamilySize"><span class="annot"><span class="annottext">tyConFamilySize :: TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier hs-var hs-var">tyConFamilySize</span></a></span></span><span> </span><span id="local-6989586621680815064"><span class="annot"><span class="annottext">tc :: TyCon
</span><a href="#local-6989586621680815064"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815063"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815063"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2387"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815063"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2388"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons_size :: AlgTyConRhs -&gt; Int
</span><a href="GHC.Core.TyCon.html#data_cons_size"><span class="hs-identifier hs-var">data_cons_size</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815062"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815062"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815062"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-2389"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-2390"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-2391"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_cons_size :: AlgTyConRhs -&gt; Int
</span><a href="GHC.Core.TyCon.html#data_cons_size"><span class="hs-identifier hs-var">data_cons_size</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815061"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815061"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680815061"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-2392"></span><span>      </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><span class="hs-identifier">_</span></span><span>                              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConFamilySize 1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815064"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2393"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilySize"><span class="hs-identifier hs-var">tyConFamilySize</span></a></span><span> </span><span id="local-6989586621680815060"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815060"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConFamilySize 2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815060"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2394"></span><span>
</span><span id="line-2395"></span><span class="hs-comment">-- | Extract an 'AlgTyConRhs' with information about data constructors from an</span><span>
</span><span id="line-2396"></span><span class="hs-comment">-- algebraic or tuple 'TyCon'. Panics for any other sort of 'TyCon'</span><span>
</span><span id="line-2397"></span><span class="annot"><a href="GHC.Core.TyCon.html#algTyConRhs"><span class="hs-identifier hs-type">algTyConRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyConRhs"><span class="hs-identifier hs-type">AlgTyConRhs</span></a></span><span>
</span><span id="line-2398"></span><span id="algTyConRhs"><span class="annot"><span class="annottext">algTyConRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTyConRhs"><span class="hs-identifier hs-var hs-var">algTyConRhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815059"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815059"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680815059"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2399"></span><span class="annot"><a href="GHC.Core.TyCon.html#algTyConRhs"><span class="hs-identifier hs-var">algTyConRhs</span></a></span><span> </span><span id="local-6989586621680815058"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815058"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; AlgTyConRhs
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;algTyConRhs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815058"><span class="hs-identifier hs-var">other</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2400"></span><span>
</span><span id="line-2401"></span><span class="hs-comment">-- | Extract type variable naming the result of injective type family</span><span>
</span><span id="line-2402"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyResVar_maybe"><span class="hs-identifier hs-type">tyConFamilyResVar_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-2403"></span><span id="tyConFamilyResVar_maybe"><span class="annot"><span class="annottext">tyConFamilyResVar_maybe :: TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#tyConFamilyResVar_maybe"><span class="hs-identifier hs-var hs-var">tyConFamilyResVar_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcResVar :: TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#famTcResVar"><span class="hs-identifier hs-var">famTcResVar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815057"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815057"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621680815057"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-2404"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyResVar_maybe"><span class="hs-identifier hs-var">tyConFamilyResVar_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Name
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2405"></span><span>
</span><span id="line-2406"></span><span class="hs-comment">-- | Get the list of roles for the type parameters of a TyCon</span><span>
</span><span id="line-2407"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRoles"><span class="hs-identifier hs-type">tyConRoles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2408"></span><span class="hs-comment">-- See also Note [TyCon Role signatures]</span><span>
</span><span id="line-2409"></span><span id="tyConRoles"><span class="annot"><span class="annottext">tyConRoles :: TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tyConRoles"><span class="hs-identifier hs-var hs-var">tyConRoles</span></a></span></span><span> </span><span id="local-6989586621680815056"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815056"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-2410"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815056"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2411"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2412"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcRoles :: TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815055"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815055"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815055"><span class="hs-identifier hs-var">roles</span></a></span><span>
</span><span id="line-2413"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcRoles :: TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815054"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815054"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815054"><span class="hs-identifier hs-var">roles</span></a></span><span>
</span><span id="line-2414"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Role -&gt; [Role]
forall {a}. a -&gt; [a]
</span><a href="#local-6989586621680815053"><span class="hs-identifier hs-var">const_role</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span>
</span><span id="line-2415"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcRoles :: TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815052"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815052"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815052"><span class="hs-identifier hs-var">roles</span></a></span><span>
</span><span id="line-2416"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcRoles :: TyCon -&gt; [Role]
</span><a href="GHC.Core.TyCon.html#tcRoles"><span class="hs-identifier hs-var">tcRoles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815051"><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815051"><span class="hs-identifier hs-var">roles</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Role]
</span><a href="#local-6989586621680815051"><span class="hs-identifier hs-var">roles</span></a></span><span>
</span><span id="line-2417"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Role -&gt; [Role]
forall {a}. a -&gt; [a]
</span><a href="#local-6989586621680815053"><span class="hs-identifier hs-var">const_role</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span>
</span><span id="line-2418"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-2419"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-2420"></span><span>    </span><span id="local-6989586621680815053"><span class="annot"><span class="annottext">const_role :: a -&gt; [a]
</span><a href="#local-6989586621680815053"><span class="hs-identifier hs-var hs-var">const_role</span></a></span></span><span> </span><span id="local-6989586621680815050"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680815050"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; a -&gt; [a]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#tyConArity"><span class="hs-identifier hs-var hs-var">tyConArity</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815056"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680815050"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-2421"></span><span>
</span><span id="line-2422"></span><span class="hs-comment">-- | Extract the bound type variables and type expansion of a type synonym</span><span>
</span><span id="line-2423"></span><span class="hs-comment">-- 'TyCon'. Panics if the 'TyCon' is not a synonym</span><span>
</span><span id="line-2424"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConRhs"><span class="hs-identifier hs-type">newTyConRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2425"></span><span id="newTyConRhs"><span class="annot"><span class="annottext">newTyConRhs :: TyCon -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#newTyConRhs"><span class="hs-identifier hs-var hs-var">newTyConRhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">tyConTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815049"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815049"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_rhs :: AlgTyConRhs -&gt; Kind
</span><a href="GHC.Core.TyCon.html#nt_rhs"><span class="hs-identifier hs-var">nt_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815048"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815048"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2426"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815049"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815048"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2427"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConRhs"><span class="hs-identifier hs-var">newTyConRhs</span></a></span><span> </span><span id="local-6989586621680815047"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815047"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ([TyVar], Kind)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newTyConRhs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815047"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2428"></span><span>
</span><span id="line-2429"></span><span class="hs-comment">-- | The number of type parameters that need to be passed to a newtype to</span><span>
</span><span id="line-2430"></span><span class="hs-comment">-- resolve it. May be less than in the definition if it can be eta-contracted.</span><span>
</span><span id="line-2431"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadArity"><span class="hs-identifier hs-type">newTyConEtadArity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-2432"></span><span id="newTyConEtadArity"><span class="annot"><span class="annottext">newTyConEtadArity :: TyCon -&gt; Int
</span><a href="GHC.Core.TyCon.html#newTyConEtadArity"><span class="hs-identifier hs-var hs-var">newTyConEtadArity</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_etad_rhs :: AlgTyConRhs -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#nt_etad_rhs"><span class="hs-identifier hs-var">nt_etad_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815046"><span class="annot"><span class="annottext">([TyVar], Kind)
</span><a href="#local-6989586621680815046"><span class="hs-identifier hs-var">tvs_rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2433"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyVar] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([TyVar], Kind) -&gt; [TyVar]
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">([TyVar], Kind)
</span><a href="#local-6989586621680815046"><span class="hs-identifier hs-var">tvs_rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2434"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadArity"><span class="hs-identifier hs-var">newTyConEtadArity</span></a></span><span> </span><span id="local-6989586621680815045"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815045"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Int
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newTyConEtadArity&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815045"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2435"></span><span>
</span><span id="line-2436"></span><span class="hs-comment">-- | Extract the bound type variables and type expansion of an eta-contracted</span><span>
</span><span id="line-2437"></span><span class="hs-comment">-- type synonym 'TyCon'.  Panics if the 'TyCon' is not a synonym</span><span>
</span><span id="line-2438"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadRhs"><span class="hs-identifier hs-type">newTyConEtadRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2439"></span><span id="newTyConEtadRhs"><span class="annot"><span class="annottext">newTyConEtadRhs :: TyCon -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#newTyConEtadRhs"><span class="hs-identifier hs-var hs-var">newTyConEtadRhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_etad_rhs :: AlgTyConRhs -&gt; ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#nt_etad_rhs"><span class="hs-identifier hs-var">nt_etad_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815044"><span class="annot"><span class="annottext">([TyVar], Kind)
</span><a href="#local-6989586621680815044"><span class="hs-identifier hs-var">tvs_rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([TyVar], Kind)
</span><a href="#local-6989586621680815044"><span class="hs-identifier hs-var">tvs_rhs</span></a></span><span>
</span><span id="line-2440"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConEtadRhs"><span class="hs-identifier hs-var">newTyConEtadRhs</span></a></span><span> </span><span id="local-6989586621680815043"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815043"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ([TyVar], Kind)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newTyConEtadRhs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815043"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2441"></span><span>
</span><span id="line-2442"></span><span class="hs-comment">-- | Extracts the @newtype@ coercion from such a 'TyCon', which can be used to</span><span>
</span><span id="line-2443"></span><span class="hs-comment">-- construct something with the @newtype@s type from its representation type</span><span>
</span><span id="line-2444"></span><span class="hs-comment">-- (right hand side). If the supplied 'TyCon' is not a @newtype@, returns</span><span>
</span><span id="line-2445"></span><span class="hs-comment">-- @Nothing@</span><span>
</span><span id="line-2446"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConCo_maybe"><span class="hs-identifier hs-type">newTyConCo_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2447"></span><span id="newTyConCo_maybe"><span class="annot"><span class="annottext">newTyConCo_maybe :: TyCon -&gt; Maybe (CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#newTyConCo_maybe"><span class="hs-identifier hs-var hs-var">newTyConCo_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nt_co :: AlgTyConRhs -&gt; CoAxiom Unbranched
</span><a href="GHC.Core.TyCon.html#nt_co"><span class="hs-identifier hs-var">nt_co</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815042"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815042"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched -&gt; Maybe (CoAxiom Unbranched)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815042"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-2448"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConCo_maybe"><span class="hs-identifier hs-var">newTyConCo_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CoAxiom Unbranched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2449"></span><span>
</span><span id="line-2450"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConCo"><span class="hs-identifier hs-type">newTyConCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span>
</span><span id="line-2451"></span><span id="newTyConCo"><span class="annot"><span class="annottext">newTyConCo :: TyCon -&gt; CoAxiom Unbranched
</span><a href="GHC.Core.TyCon.html#newTyConCo"><span class="hs-identifier hs-var hs-var">newTyConCo</span></a></span></span><span> </span><span id="local-6989586621680815041"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815041"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe (CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#newTyConCo_maybe"><span class="hs-identifier hs-var">newTyConCo_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815041"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2452"></span><span>                 </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680815040"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815040"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815040"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-2453"></span><span>                 </span><span class="annot"><span class="annottext">Maybe (CoAxiom Unbranched)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; CoAxiom Unbranched
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newTyConCo&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815041"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2454"></span><span>
</span><span id="line-2455"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConDataCon_maybe"><span class="hs-identifier hs-type">newTyConDataCon_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-2456"></span><span id="newTyConDataCon_maybe"><span class="annot"><span class="annottext">newTyConDataCon_maybe :: TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#newTyConDataCon_maybe"><span class="hs-identifier hs-var hs-var">newTyConDataCon_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">data_con :: AlgTyConRhs -&gt; DataCon
</span><a href="GHC.Core.TyCon.html#data_con"><span class="hs-identifier hs-var">data_con</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815039"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815039"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Maybe DataCon
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680815039"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-2457"></span><span class="annot"><a href="GHC.Core.TyCon.html#newTyConDataCon_maybe"><span class="hs-identifier hs-var">newTyConDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DataCon
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2458"></span><span>
</span><span id="line-2459"></span><span class="hs-comment">-- | Find the \&quot;stupid theta\&quot; of the 'TyCon'. A \&quot;stupid theta\&quot; is the context</span><span>
</span><span id="line-2460"></span><span class="hs-comment">-- to the left of an algebraic type declaration, e.g. @Eq a@ in the declaration</span><span>
</span><span id="line-2461"></span><span class="hs-comment">-- @data Eq a =&gt; T a ...@</span><span>
</span><span id="line-2462"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConStupidTheta"><span class="hs-identifier hs-type">tyConStupidTheta</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2463"></span><span id="tyConStupidTheta"><span class="annot"><span class="annottext">tyConStupidTheta :: TyCon -&gt; [Kind]
</span><a href="GHC.Core.TyCon.html#tyConStupidTheta"><span class="hs-identifier hs-var hs-var">tyConStupidTheta</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcStupidTheta :: TyCon -&gt; [Kind]
</span><a href="GHC.Core.TyCon.html#algTcStupidTheta"><span class="hs-identifier hs-var">algTcStupidTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815038"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815038"><span class="hs-identifier hs-var">stupid</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815038"><span class="hs-identifier hs-var">stupid</span></a></span><span>
</span><span id="line-2464"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConStupidTheta"><span class="hs-identifier hs-var">tyConStupidTheta</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-2465"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConStupidTheta"><span class="hs-identifier hs-var">tyConStupidTheta</span></a></span><span> </span><span id="local-6989586621680815037"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815037"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [Kind]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConStupidTheta&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815037"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2466"></span><span>
</span><span id="line-2467"></span><span class="hs-comment">-- | Extract the 'TyVar's bound by a vanilla type synonym</span><span>
</span><span id="line-2468"></span><span class="hs-comment">-- and the corresponding (unsubstituted) right hand side.</span><span>
</span><span id="line-2469"></span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConDefn_maybe"><span class="hs-identifier hs-type">synTyConDefn_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2470"></span><span id="synTyConDefn_maybe"><span class="annot"><span class="annottext">synTyConDefn_maybe :: TyCon -&gt; Maybe ([TyVar], Kind)
</span><a href="GHC.Core.TyCon.html#synTyConDefn_maybe"><span class="hs-identifier hs-var hs-var">synTyConDefn_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">tyConTyVars :: TyCon -&gt; [TyVar]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var">tyConTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815036"><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815036"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">synTcRhs :: TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#synTcRhs"><span class="hs-identifier hs-var">synTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815035"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815035"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2471"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([TyVar], Kind) -&gt; Maybe ([TyVar], Kind)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680815036"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815035"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2472"></span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConDefn_maybe"><span class="hs-identifier hs-var">synTyConDefn_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([TyVar], Kind)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2473"></span><span>
</span><span id="line-2474"></span><span class="hs-comment">-- | Extract the information pertaining to the right hand side of a type synonym</span><span>
</span><span id="line-2475"></span><span class="hs-comment">-- (@type@) declaration.</span><span>
</span><span id="line-2476"></span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConRhs_maybe"><span class="hs-identifier hs-type">synTyConRhs_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-2477"></span><span id="synTyConRhs_maybe"><span class="annot"><span class="annottext">synTyConRhs_maybe :: TyCon -&gt; Maybe Kind
</span><a href="GHC.Core.TyCon.html#synTyConRhs_maybe"><span class="hs-identifier hs-var hs-var">synTyConRhs_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">synTcRhs :: TyCon -&gt; Kind
</span><a href="GHC.Core.TyCon.html#synTcRhs"><span class="hs-identifier hs-var">synTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815034"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815034"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Maybe Kind
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621680815034"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-2478"></span><span class="annot"><a href="GHC.Core.TyCon.html#synTyConRhs_maybe"><span class="hs-identifier hs-var">synTyConRhs_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Kind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2479"></span><span>
</span><span id="line-2480"></span><span class="hs-comment">-- | Extract the flavour of a type family (with all the extra information that</span><span>
</span><span id="line-2481"></span><span class="hs-comment">-- it carries)</span><span>
</span><span id="line-2482"></span><span class="annot"><a href="GHC.Core.TyCon.html#famTyConFlav_maybe"><span class="hs-identifier hs-type">famTyConFlav_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#FamTyConFlav"><span class="hs-identifier hs-type">FamTyConFlav</span></a></span><span>
</span><span id="line-2483"></span><span id="famTyConFlav_maybe"><span class="annot"><span class="annottext">famTyConFlav_maybe :: TyCon -&gt; Maybe FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTyConFlav_maybe"><span class="hs-identifier hs-var hs-var">famTyConFlav_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815033"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815033"><span class="hs-identifier hs-var">flav</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav -&gt; Maybe FamTyConFlav
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680815033"><span class="hs-identifier hs-var">flav</span></a></span><span>
</span><span id="line-2484"></span><span class="annot"><a href="GHC.Core.TyCon.html#famTyConFlav_maybe"><span class="hs-identifier hs-var">famTyConFlav_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FamTyConFlav
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2485"></span><span>
</span><span id="line-2486"></span><span class="hs-comment">-- | Is this 'TyCon' that for a class instance?</span><span>
</span><span id="line-2487"></span><span class="annot"><a href="GHC.Core.TyCon.html#isClassTyCon"><span class="hs-identifier hs-type">isClassTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2488"></span><span id="isClassTyCon"><span class="annot"><span class="annottext">isClassTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isClassTyCon"><span class="hs-identifier hs-var hs-var">isClassTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2489"></span><span class="annot"><a href="GHC.Core.TyCon.html#isClassTyCon"><span class="hs-identifier hs-var">isClassTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2490"></span><span>
</span><span id="line-2491"></span><span class="hs-comment">-- | If this 'TyCon' is that for a class instance, return the class it is for.</span><span>
</span><span id="line-2492"></span><span class="hs-comment">-- Otherwise returns @Nothing@</span><span>
</span><span id="line-2493"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConClass_maybe"><span class="hs-identifier hs-type">tyConClass_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span>
</span><span id="line-2494"></span><span id="tyConClass_maybe"><span class="annot"><span class="annottext">tyConClass_maybe :: TyCon -&gt; Maybe Class
</span><a href="GHC.Core.TyCon.html#tyConClass_maybe"><span class="hs-identifier hs-var hs-var">tyConClass_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span id="local-6989586621680815032"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815032"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; Maybe Class
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815032"><span class="hs-identifier hs-var">clas</span></a></span><span>
</span><span id="line-2495"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConClass_maybe"><span class="hs-identifier hs-var">tyConClass_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Class
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2496"></span><span>
</span><span id="line-2497"></span><span class="hs-comment">-- | Return the associated types of the 'TyCon', if any</span><span>
</span><span id="line-2498"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConATs"><span class="hs-identifier hs-type">tyConATs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2499"></span><span id="tyConATs"><span class="annot"><span class="annottext">tyConATs :: TyCon -&gt; [TyCon]
</span><a href="GHC.Core.TyCon.html#tyConATs"><span class="hs-identifier hs-var hs-var">tyConATs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span id="local-6989586621680815031"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815031"><span class="hs-identifier hs-var">clas</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [TyCon]
</span><a href="GHC.Core.Class.html#classATs"><span class="hs-identifier hs-var">classATs</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621680815031"><span class="hs-identifier hs-var">clas</span></a></span><span>
</span><span id="line-2500"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConATs"><span class="hs-identifier hs-var">tyConATs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-2501"></span><span>
</span><span id="line-2502"></span><span class="hs-comment">----------------------------------------------------------------------------</span><span>
</span><span id="line-2503"></span><span class="hs-comment">-- | Is this 'TyCon' that for a data family instance?</span><span>
</span><span id="line-2504"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamInstTyCon"><span class="hs-identifier hs-type">isFamInstTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2505"></span><span id="isFamInstTyCon"><span class="annot"><span class="annottext">isFamInstTyCon :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isFamInstTyCon"><span class="hs-identifier hs-var hs-var">isFamInstTyCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2506"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2507"></span><span class="annot"><a href="GHC.Core.TyCon.html#isFamInstTyCon"><span class="hs-identifier hs-var">isFamInstTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2508"></span><span>
</span><span id="line-2509"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInstSig_maybe"><span class="hs-identifier hs-type">tyConFamInstSig_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2510"></span><span id="tyConFamInstSig_maybe"><span class="annot"><span class="annottext">tyConFamInstSig_maybe :: TyCon -&gt; Maybe (TyCon, [Kind], CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#tyConFamInstSig_maybe"><span class="hs-identifier hs-var hs-var">tyConFamInstSig_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span id="local-6989586621680815029"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815029"><span class="hs-identifier hs-var">ax</span></a></span></span><span> </span><span id="local-6989586621680815028"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815028"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680815027"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815027"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2511"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCon, [Kind], CoAxiom Unbranched)
-&gt; Maybe (TyCon, [Kind], CoAxiom Unbranched)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815028"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815027"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815029"><span class="hs-identifier hs-var">ax</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2512"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInstSig_maybe"><span class="hs-identifier hs-var">tyConFamInstSig_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (TyCon, [Kind], CoAxiom Unbranched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2513"></span><span>
</span><span id="line-2514"></span><span class="hs-comment">-- | If this 'TyCon' is that of a data family instance, return the family in question</span><span>
</span><span id="line-2515"></span><span class="hs-comment">-- and the instance types. Otherwise, return @Nothing@</span><span>
</span><span id="line-2516"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInst_maybe"><span class="hs-identifier hs-type">tyConFamInst_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-2517"></span><span id="tyConFamInst_maybe"><span class="annot"><span class="annottext">tyConFamInst_maybe :: TyCon -&gt; Maybe (TyCon, [Kind])
</span><a href="GHC.Core.TyCon.html#tyConFamInst_maybe"><span class="hs-identifier hs-var hs-var">tyConFamInst_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680815026"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815026"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680815025"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815025"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2518"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCon, [Kind]) -&gt; Maybe (TyCon, [Kind])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815026"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621680815025"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2519"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamInst_maybe"><span class="hs-identifier hs-var">tyConFamInst_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (TyCon, [Kind])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2520"></span><span>
</span><span id="line-2521"></span><span class="hs-comment">-- | If this 'TyCon' is that of a data family instance, return a 'TyCon' which</span><span>
</span><span id="line-2522"></span><span class="hs-comment">-- represents a coercion identifying the representation type with the type</span><span>
</span><span id="line-2523"></span><span class="hs-comment">-- instance family.  Otherwise, return @Nothing@</span><span>
</span><span id="line-2524"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyCoercion_maybe"><span class="hs-identifier hs-type">tyConFamilyCoercion_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#CoAxiom"><span class="hs-identifier hs-type">CoAxiom</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Unbranched"><span class="hs-identifier hs-type">Unbranched</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2525"></span><span id="tyConFamilyCoercion_maybe"><span class="annot"><span class="annottext">tyConFamilyCoercion_maybe :: TyCon -&gt; Maybe (CoAxiom Unbranched)
</span><a href="GHC.Core.TyCon.html#tyConFamilyCoercion_maybe"><span class="hs-identifier hs-var hs-var">tyConFamilyCoercion_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamInstTyCon"><span class="hs-identifier hs-type">DataFamInstTyCon</span></a></span><span> </span><span id="local-6989586621680815024"><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815024"><span class="hs-identifier hs-var">ax</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2526"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched -&gt; Maybe (CoAxiom Unbranched)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Unbranched
</span><a href="#local-6989586621680815024"><span class="hs-identifier hs-var">ax</span></a></span><span>
</span><span id="line-2527"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFamilyCoercion_maybe"><span class="hs-identifier hs-var">tyConFamilyCoercion_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (CoAxiom Unbranched)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2528"></span><span>
</span><span id="line-2529"></span><span class="hs-comment">-- | Extract any 'RuntimeRepInfo' from this TyCon</span><span>
</span><span id="line-2530"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRuntimeRepInfo"><span class="hs-identifier hs-type">tyConRuntimeRepInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RuntimeRepInfo"><span class="hs-identifier hs-type">RuntimeRepInfo</span></a></span><span>
</span><span id="line-2531"></span><span id="tyConRuntimeRepInfo"><span class="annot"><span class="annottext">tyConRuntimeRepInfo :: TyCon -&gt; RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#tyConRuntimeRepInfo"><span class="hs-identifier hs-var hs-var">tyConRuntimeRepInfo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">promDcRepInfo :: TyCon -&gt; RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#promDcRepInfo"><span class="hs-identifier hs-var">promDcRepInfo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680815023"><span class="annot"><span class="annottext">RuntimeRepInfo
</span><a href="#local-6989586621680815023"><span class="hs-identifier hs-var">rri</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuntimeRepInfo
</span><a href="#local-6989586621680815023"><span class="hs-identifier hs-var">rri</span></a></span><span>
</span><span id="line-2532"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConRuntimeRepInfo"><span class="hs-identifier hs-var">tyConRuntimeRepInfo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuntimeRepInfo
</span><a href="GHC.Core.TyCon.html#NoRRI"><span class="hs-identifier hs-var">NoRRI</span></a></span><span>
</span><span id="line-2533"></span><span>  </span><span class="hs-comment">-- could panic in that second case. But Douglas Adams told me not to.</span><span>
</span><span id="line-2534"></span><span>
</span><span id="line-2535"></span><span class="hs-comment">{-
Note [Constructor tag allocation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When typechecking we need to allocate constructor tags to constructors.
They are allocated based on the position in the data_cons field of TyCon,
with the first constructor getting fIRST_TAG.

We used to pay linear cost per constructor, with each constructor looking up
its relative index in the constructor list. That was quadratic and prohibitive
for large data types with more than 10k constructors.

The current strategy is to build a NameEnv with a mapping from constructor's
Name to ConTag and pass it down to buildDataCon for efficient lookup.

Relevant ticket: #14657
-}</span><span>
</span><span id="line-2551"></span><span>
</span><span id="line-2552"></span><span class="annot"><a href="GHC.Core.TyCon.html#mkTyConTagMap"><span class="hs-identifier hs-type">mkTyConTagMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#ConTag"><span class="hs-identifier hs-type">ConTag</span></a></span><span>
</span><span id="line-2553"></span><span id="mkTyConTagMap"><span class="annot"><span class="annottext">mkTyConTagMap :: TyCon -&gt; NameEnv Int
</span><a href="GHC.Core.TyCon.html#mkTyConTagMap"><span class="hs-identifier hs-var hs-var">mkTyConTagMap</span></a></span></span><span> </span><span id="local-6989586621680815021"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815021"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2554"></span><span>  </span><span class="annot"><span class="annottext">[(Name, Int)] -&gt; NameEnv Int
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([(Name, Int)] -&gt; NameEnv Int) -&gt; [(Name, Int)] -&gt; NameEnv Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(DataCon -&gt; Name) -&gt; [DataCon] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815021"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Int] -&gt; [(Name, Int)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Types.Basic.html#fIRST_TAG"><span class="hs-identifier hs-var">fIRST_TAG</span></a></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span>
</span><span id="line-2555"></span><span>  </span><span class="hs-comment">-- See Note [Constructor tag allocation]</span><span>
</span><span id="line-2556"></span><span>
</span><span id="line-2557"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection[TyCon-instances]{Instance declarations for @TyCon@}
*                                                                      *
************************************************************************

@TyCon@s are compared by comparing their @Unique@s.
-}</span><span>
</span><span id="line-2566"></span><span>
</span><span id="line-2567"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2568"></span><span>    </span><span id="local-6989586621680815011"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815011"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680815010"><span class="annot"><span class="annottext">== :: TyCon -&gt; TyCon -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></span></span><span> </span><span id="local-6989586621680815009"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815009"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815011"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815009"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-2569"></span><span>    </span><span id="local-6989586621680815005"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815005"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680815004"><span class="annot"><span class="annottext">/= :: TyCon -&gt; TyCon -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">/=</span></span></span><span> </span><span id="local-6989586621680815002"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815002"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815005"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680815002"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-2570"></span><span>
</span><span id="line-2571"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2572"></span><span>    </span><span id="local-6989586621680814999"><span class="annot"><span class="annottext">getUnique :: TyCon -&gt; Unique
</span><a href="#local-6989586621680814999"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUnique</span></a></span></span><span> </span><span id="local-6989586621680814998"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814998"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique
</span><a href="GHC.Core.TyCon.html#tyConUnique"><span class="hs-identifier hs-var hs-var">tyConUnique</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814998"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-2573"></span><span>
</span><span id="line-2574"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814995"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2575"></span><span>  </span><span class="hs-comment">-- At the moment a promoted TyCon has the same Name as its</span><span>
</span><span id="line-2576"></span><span>  </span><span class="hs-comment">-- corresponding TyCon, so we add the quote to distinguish it here</span><span>
</span><span id="line-2577"></span><span>  </span><span id="local-6989586621680814993"><span class="annot"><span class="annottext">ppr :: TyCon -&gt; SDoc
</span><a href="#local-6989586621680814993"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680814992"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814992"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
</span><a href="GHC.Core.TyCon.html#pprPromotionQuote"><span class="hs-identifier hs-var">pprPromotionQuote</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814992"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814992"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680814991"><span class="hs-identifier hs-var">pp_tc</span></a></span><span>
</span><span id="line-2578"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-2579"></span><span>      </span><span id="local-6989586621680814991"><span class="annot"><span class="annottext">pp_tc :: SDoc
</span><a href="#local-6989586621680814991"><span class="hs-identifier hs-var hs-var">pp_tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PprStyle -&gt; SDoc) -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#getPprStyle"><span class="hs-identifier hs-var">getPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">((PprStyle -&gt; SDoc) -&gt; SDoc) -&gt; (PprStyle -&gt; SDoc) -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680814989"><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680814989"><span class="hs-identifier hs-var">sty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-2580"></span><span>              </span><span class="annot"><span class="annottext">(Bool -&gt; SDoc) -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#getPprDebug"><span class="hs-identifier hs-var">getPprDebug</span></a></span><span> </span><span class="annot"><span class="annottext">((Bool -&gt; SDoc) -&gt; SDoc) -&gt; (Bool -&gt; SDoc) -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680814987"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680814987"><span class="hs-identifier hs-var">debug</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-2581"></span><span>               </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680814987"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; Bool
</span><a href="GHC.Utils.Outputable.html#dumpStyle"><span class="hs-identifier hs-var">dumpStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680814989"><span class="hs-identifier hs-var">sty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTcTyCon"><span class="hs-identifier hs-var">isTcTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814992"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2582"></span><span>                  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;[tc]&quot;</span></span><span>
</span><span id="line-2583"></span><span>                  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-2584"></span><span>
</span><span id="line-2585"></span><span class="hs-comment">-- | Paints a picture of what a 'TyCon' represents, in broad strokes.</span><span>
</span><span id="line-2586"></span><span class="hs-comment">-- This is used towards more informative error messages.</span><span>
</span><span id="line-2587"></span><span class="hs-keyword">data</span><span> </span><span id="TyConFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-var">TyConFlavour</span></a></span></span><span>
</span><span id="line-2588"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="ClassFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span></span><span>
</span><span id="line-2589"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TupleFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#TupleFlavour"><span class="hs-identifier hs-var">TupleFlavour</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Boxity"><span class="hs-identifier hs-type">Boxity</span></a></span><span>
</span><span id="line-2590"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SumFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#SumFlavour"><span class="hs-identifier hs-var">SumFlavour</span></a></span></span><span>
</span><span id="line-2591"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DataTypeFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#DataTypeFlavour"><span class="hs-identifier hs-var">DataTypeFlavour</span></a></span></span><span>
</span><span id="line-2592"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NewtypeFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#NewtypeFlavour"><span class="hs-identifier hs-var">NewtypeFlavour</span></a></span></span><span>
</span><span id="line-2593"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="AbstractTypeFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTypeFlavour"><span class="hs-identifier hs-var">AbstractTypeFlavour</span></a></span></span><span>
</span><span id="line-2594"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DataFamilyFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-var">DataFamilyFlavour</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- Just tc &lt;=&gt; (tc == associated class)</span><span>
</span><span id="line-2595"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="OpenTypeFamilyFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-var">OpenTypeFamilyFlavour</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Just tc &lt;=&gt; (tc == associated class)</span><span>
</span><span id="line-2596"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ClosedTypeFamilyFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span></span><span>
</span><span id="line-2597"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TypeSynonymFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#TypeSynonymFlavour"><span class="hs-identifier hs-var">TypeSynonymFlavour</span></a></span></span><span>
</span><span id="line-2598"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="BuiltInTypeFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span></span><span> </span><span class="hs-comment">-- ^ e.g., the @(-&gt;)@ 'TyCon'.</span><span>
</span><span id="line-2599"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PromotedDataConFlavour"><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataConFlavour"><span class="hs-identifier hs-var">PromotedDataConFlavour</span></a></span></span><span>
</span><span id="line-2600"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621680814965"><span id="local-6989586621680814972"><span class="annot"><span class="annottext">TyConFlavour -&gt; TyConFlavour -&gt; Bool
(TyConFlavour -&gt; TyConFlavour -&gt; Bool)
-&gt; (TyConFlavour -&gt; TyConFlavour -&gt; Bool) -&gt; Eq TyConFlavour
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: TyConFlavour -&gt; TyConFlavour -&gt; Bool
$c/= :: TyConFlavour -&gt; TyConFlavour -&gt; Bool
== :: TyConFlavour -&gt; TyConFlavour -&gt; Bool
$c== :: TyConFlavour -&gt; TyConFlavour -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span>
</span><span id="line-2601"></span><span>
</span><span id="line-2602"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814962"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2603"></span><span>  </span><span id="local-6989586621680814961"><span class="annot"><span class="annottext">ppr :: TyConFlavour -&gt; SDoc
</span><a href="#local-6989586621680814961"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc)
-&gt; (TyConFlavour -&gt; String) -&gt; TyConFlavour -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour -&gt; String
</span><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-2604"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-2605"></span><span>      </span><span id="local-6989586621680814960"><span class="annot"><span class="annottext">go :: TyConFlavour -&gt; String
</span><a href="#local-6989586621680814960"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;class&quot;</span></span><span>
</span><span id="line-2606"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TupleFlavour"><span class="hs-identifier hs-type">TupleFlavour</span></a></span><span> </span><span id="local-6989586621680814959"><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621680814959"><span class="hs-identifier hs-var">boxed</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Boxity -&gt; Bool
</span><a href="GHC.Types.Basic.html#isBoxed"><span class="hs-identifier hs-var">isBoxed</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621680814959"><span class="hs-identifier hs-var">boxed</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tuple&quot;</span></span><span>
</span><span id="line-2607"></span><span>                              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unboxed tuple&quot;</span></span><span>
</span><span id="line-2608"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#SumFlavour"><span class="hs-identifier hs-var">SumFlavour</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unboxed sum&quot;</span></span><span>
</span><span id="line-2609"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#DataTypeFlavour"><span class="hs-identifier hs-var">DataTypeFlavour</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;data type&quot;</span></span><span>
</span><span id="line-2610"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#NewtypeFlavour"><span class="hs-identifier hs-var">NewtypeFlavour</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newtype&quot;</span></span><span>
</span><span id="line-2611"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#AbstractTypeFlavour"><span class="hs-identifier hs-var">AbstractTypeFlavour</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;abstract type&quot;</span></span><span>
</span><span id="line-2612"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-type">DataFamilyFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;associated data family&quot;</span></span><span>
</span><span id="line-2613"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-type">DataFamilyFlavour</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;data family&quot;</span></span><span>
</span><span id="line-2614"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-type">OpenTypeFamilyFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;associated type family&quot;</span></span><span>
</span><span id="line-2615"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-type">OpenTypeFamilyFlavour</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type family&quot;</span></span><span>
</span><span id="line-2616"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type family&quot;</span></span><span>
</span><span id="line-2617"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#TypeSynonymFlavour"><span class="hs-identifier hs-var">TypeSynonymFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type synonym&quot;</span></span><span>
</span><span id="line-2618"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;built-in type&quot;</span></span><span>
</span><span id="line-2619"></span><span>      </span><span class="annot"><a href="#local-6989586621680814960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#PromotedDataConFlavour"><span class="hs-identifier hs-var">PromotedDataConFlavour</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;promoted data constructor&quot;</span></span><span>
</span><span id="line-2620"></span><span>
</span><span id="line-2621"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-type">tyConFlavour</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span>
</span><span id="line-2622"></span><span id="tyConFlavour"><span class="annot"><span class="annottext">tyConFlavour :: TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var hs-var">tyConFlavour</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#AlgTyCon"><span class="hs-identifier hs-type">AlgTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">algTcParent :: TyCon -&gt; AlgTyConFlav
</span><a href="GHC.Core.TyCon.html#algTcParent"><span class="hs-identifier hs-var">algTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814958"><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680814958"><span class="hs-identifier hs-var">parent</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">algTcRhs :: TyCon -&gt; AlgTyConRhs
</span><a href="GHC.Core.TyCon.html#algTcRhs"><span class="hs-identifier hs-var">algTcRhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814957"><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680814957"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2623"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#ClassTyCon"><span class="hs-identifier hs-type">ClassTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AlgTyConFlav
</span><a href="#local-6989586621680814958"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span>
</span><span id="line-2624"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">AlgTyConRhs
</span><a href="#local-6989586621680814957"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2625"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleTyCon"><span class="hs-identifier hs-type">TupleTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tup_sort :: AlgTyConRhs -&gt; TupleSort
</span><a href="GHC.Core.TyCon.html#tup_sort"><span class="hs-identifier hs-var">tup_sort</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814956"><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680814956"><span class="hs-identifier hs-var">sort</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-2626"></span><span>                                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Boxity -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#TupleFlavour"><span class="hs-identifier hs-var">TupleFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TupleSort -&gt; Boxity
</span><a href="GHC.Types.Basic.html#tupleSortBoxity"><span class="hs-identifier hs-var">tupleSortBoxity</span></a></span><span> </span><span class="annot"><span class="annottext">TupleSort
</span><a href="#local-6989586621680814956"><span class="hs-identifier hs-var">sort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2627"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCon.html#SumTyCon"><span class="hs-identifier hs-type">SumTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#SumFlavour"><span class="hs-identifier hs-var">SumFlavour</span></a></span><span>
</span><span id="line-2628"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCon.html#DataTyCon"><span class="hs-identifier hs-type">DataTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#DataTypeFlavour"><span class="hs-identifier hs-var">DataTypeFlavour</span></a></span><span>
</span><span id="line-2629"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCon.html#NewTyCon"><span class="hs-identifier hs-type">NewTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#NewtypeFlavour"><span class="hs-identifier hs-var">NewtypeFlavour</span></a></span><span>
</span><span id="line-2630"></span><span>                  </span><span class="annot"><a href="GHC.Core.TyCon.html#AbstractTyCon"><span class="hs-identifier hs-type">AbstractTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#AbstractTypeFlavour"><span class="hs-identifier hs-var">AbstractTypeFlavour</span></a></span><span>
</span><span id="line-2631"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FamilyTyCon"><span class="hs-identifier hs-type">FamilyTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">famTcFlav :: TyCon -&gt; FamTyConFlav
</span><a href="GHC.Core.TyCon.html#famTcFlav"><span class="hs-identifier hs-var">famTcFlav</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814955"><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680814955"><span class="hs-identifier hs-var">flav</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">famTcParent :: TyCon -&gt; Maybe TyCon
</span><a href="GHC.Core.TyCon.html#famTcParent"><span class="hs-identifier hs-var">famTcParent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814954"><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680814954"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-2632"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="#local-6989586621680814955"><span class="hs-identifier hs-var">flav</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2633"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyTyCon"><span class="hs-identifier hs-type">DataFamilyTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-var">DataFamilyFlavour</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680814954"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-2634"></span><span>      </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#OpenSynFamilyTyCon"><span class="hs-identifier hs-var">OpenSynFamilyTyCon</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-var">OpenTypeFamilyFlavour</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621680814954"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-2635"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#ClosedSynFamilyTyCon"><span class="hs-identifier hs-type">ClosedSynFamilyTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span>
</span><span id="line-2636"></span><span>      </span><span class="annot"><span class="annottext">FamTyConFlav
</span><a href="GHC.Core.TyCon.html#AbstractClosedSynFamilyTyCon"><span class="hs-identifier hs-var">AbstractClosedSynFamilyTyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span>
</span><span id="line-2637"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#BuiltInSynFamTyCon"><span class="hs-identifier hs-type">BuiltInSynFamTyCon</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span>
</span><span id="line-2638"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#SynonymTyCon"><span class="hs-identifier hs-type">SynonymTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#TypeSynonymFlavour"><span class="hs-identifier hs-var">TypeSynonymFlavour</span></a></span><span>
</span><span id="line-2639"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#FunTyCon"><span class="hs-identifier hs-type">FunTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span><span>
</span><span id="line-2640"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimTyCon"><span class="hs-identifier hs-type">PrimTyCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span><span>
</span><span id="line-2641"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#PromotedDataConFlavour"><span class="hs-identifier hs-var">PromotedDataConFlavour</span></a></span><span>
</span><span id="line-2642"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConFlavour"><span class="hs-identifier hs-var">tyConFlavour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#TcTyCon"><span class="hs-identifier hs-type">TcTyCon</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcTyConFlavour :: TyCon -&gt; TyConFlavour
</span><a href="GHC.Core.TyCon.html#tcTyConFlavour"><span class="hs-identifier hs-var">tcTyConFlavour</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680814953"><span class="annot"><span class="annottext">TyConFlavour
</span><a href="#local-6989586621680814953"><span class="hs-identifier hs-var">flav</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="#local-6989586621680814953"><span class="hs-identifier hs-var">flav</span></a></span><span>
</span><span id="line-2643"></span><span>
</span><span id="line-2644"></span><span class="hs-comment">-- | Can this flavour of 'TyCon' appear unsaturated?</span><span>
</span><span id="line-2645"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-type">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2646"></span><span id="tcFlavourMustBeSaturated"><span class="annot"><span class="annottext">tcFlavourMustBeSaturated :: TyConFlavour -&gt; Bool
</span><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var hs-var">tcFlavourMustBeSaturated</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2647"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#DataTypeFlavour"><span class="hs-identifier hs-var">DataTypeFlavour</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2648"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#NewtypeFlavour"><span class="hs-identifier hs-var">NewtypeFlavour</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2649"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-type">DataFamilyFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2650"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleFlavour"><span class="hs-identifier hs-type">TupleFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2651"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#SumFlavour"><span class="hs-identifier hs-var">SumFlavour</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2652"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#AbstractTypeFlavour"><span class="hs-identifier hs-var">AbstractTypeFlavour</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2653"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2654"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#PromotedDataConFlavour"><span class="hs-identifier hs-var">PromotedDataConFlavour</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2655"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#TypeSynonymFlavour"><span class="hs-identifier hs-var">TypeSynonymFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2656"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-type">OpenTypeFamilyFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2657"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourMustBeSaturated"><span class="hs-identifier hs-var">tcFlavourMustBeSaturated</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2658"></span><span>
</span><span id="line-2659"></span><span class="hs-comment">-- | Is this flavour of 'TyCon' an open type family or a data family?</span><span>
</span><span id="line-2660"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-type">tcFlavourIsOpen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyConFlavour"><span class="hs-identifier hs-type">TyConFlavour</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2661"></span><span id="tcFlavourIsOpen"><span class="annot"><span class="annottext">tcFlavourIsOpen :: TyConFlavour -&gt; Bool
</span><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var hs-var">tcFlavourIsOpen</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#DataFamilyFlavour"><span class="hs-identifier hs-type">DataFamilyFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2662"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#OpenTypeFamilyFlavour"><span class="hs-identifier hs-type">OpenTypeFamilyFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-2663"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClosedTypeFamilyFlavour"><span class="hs-identifier hs-var">ClosedTypeFamilyFlavour</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2664"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#ClassFlavour"><span class="hs-identifier hs-var">ClassFlavour</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2665"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#DataTypeFlavour"><span class="hs-identifier hs-var">DataTypeFlavour</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2666"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#NewtypeFlavour"><span class="hs-identifier hs-var">NewtypeFlavour</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2667"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TupleFlavour"><span class="hs-identifier hs-type">TupleFlavour</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2668"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#SumFlavour"><span class="hs-identifier hs-var">SumFlavour</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2669"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#AbstractTypeFlavour"><span class="hs-identifier hs-var">AbstractTypeFlavour</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2670"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#BuiltInTypeFlavour"><span class="hs-identifier hs-var">BuiltInTypeFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2671"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#PromotedDataConFlavour"><span class="hs-identifier hs-var">PromotedDataConFlavour</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2672"></span><span class="annot"><a href="GHC.Core.TyCon.html#tcFlavourIsOpen"><span class="hs-identifier hs-var">tcFlavourIsOpen</span></a></span><span> </span><span class="annot"><span class="annottext">TyConFlavour
</span><a href="GHC.Core.TyCon.html#TypeSynonymFlavour"><span class="hs-identifier hs-var">TypeSynonymFlavour</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-2673"></span><span>
</span><span id="line-2674"></span><span class="annot"><a href="GHC.Core.TyCon.html#pprPromotionQuote"><span class="hs-identifier hs-type">pprPromotionQuote</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-2675"></span><span class="hs-comment">-- Promoted data constructors already have a tick in their OccName</span><span>
</span><span id="line-2676"></span><span id="pprPromotionQuote"><span class="annot"><span class="annottext">pprPromotionQuote :: TyCon -&gt; SDoc
</span><a href="GHC.Core.TyCon.html#pprPromotionQuote"><span class="hs-identifier hs-var hs-var">pprPromotionQuote</span></a></span></span><span> </span><span id="local-6989586621680814952"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814952"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-2677"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814952"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2678"></span><span>      </span><span class="annot"><a href="GHC.Core.TyCon.html#PromotedDataCon"><span class="hs-identifier hs-type">PromotedDataCon</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="hs-comment">-- Always quote promoted DataCons in types</span><span>
</span><span id="line-2679"></span><span>      </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-2680"></span><span>
</span><span id="line-2681"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814949"><span class="annot"><a href="GHC.Types.Name.html#NamedThing"><span class="hs-identifier hs-type">NamedThing</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2682"></span><span>    </span><span id="local-6989586621680814946"><span class="annot"><span class="annottext">getName :: TyCon -&gt; Name
</span><a href="#local-6989586621680814946"><span class="hs-identifier hs-var hs-var hs-var hs-var">getName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span>
</span><span id="line-2683"></span><span>
</span><span id="line-2684"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814919"><span id="local-6989586621680814921"><span id="local-6989586621680814923"><span id="local-6989586621680814925"><span id="local-6989586621680814927"><span id="local-6989586621680814929"><span id="local-6989586621680814931"><span id="local-6989586621680814933"><span id="local-6989586621680814935"><span id="local-6989586621680814937"><span id="local-6989586621680814942"><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-type">Data.Data</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2685"></span><span>    </span><span class="hs-comment">-- don't traverse?</span><span>
</span><span id="line-2686"></span><span>    </span><span id="local-6989586621680814917"><span class="annot"><span class="annottext">toConstr :: TyCon -&gt; Constr
</span><a href="../../base/src/Data.Data.html#toConstr"><span class="hs-identifier hs-var hs-var hs-var hs-var">toConstr</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr
</span><a href="GHC.Utils.Misc.html#abstractConstr"><span class="hs-identifier hs-var">abstractConstr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;TyCon&quot;</span></span><span>
</span><span id="line-2687"></span><span>    </span><span id="local-6989586621680814912"><span class="annot"><span class="annottext">gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c TyCon
</span><a href="../../base/src/Data.Data.html#gunfold"><span class="hs-identifier hs-var hs-var hs-var hs-var">gunfold</span></a></span></span><span> </span><span class="annot"><span class="annottext">forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">forall r. r -&gt; c r
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr -&gt; c TyCon
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;gunfold&quot;</span></span><span>
</span><span id="line-2688"></span><span>    </span><span id="local-6989586621680814909"><span class="annot"><span class="annottext">dataTypeOf :: TyCon -&gt; DataType
</span><a href="../../base/src/Data.Data.html#dataTypeOf"><span class="hs-identifier hs-var hs-var hs-var hs-var">dataTypeOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DataType
</span><a href="../../base/src/Data.Data.html#mkNoRepType"><span class="hs-identifier hs-var">mkNoRepType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;TyCon&quot;</span></span><span>
</span><span id="line-2689"></span><span>
</span><span id="line-2690"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814904"><span class="annot"><a href="GHC.Utils.Binary.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#Injectivity"><span class="hs-identifier hs-type">Injectivity</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2691"></span><span>    </span><span id="local-6989586621680814895"><span class="annot"><span class="annottext">put_ :: BinHandle -&gt; Injectivity -&gt; IO ()
</span><a href="#local-6989586621680814895"><span class="hs-identifier hs-var hs-var hs-var hs-var">put_</span></a></span></span><span> </span><span id="local-6989586621680814894"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814894"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="annot"><span class="annottext">Injectivity
</span><a href="GHC.Core.TyCon.html#NotInjective"><span class="hs-identifier hs-var">NotInjective</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814894"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span>
</span><span id="line-2692"></span><span>    </span><span class="annot"><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span id="local-6989586621680814893"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814893"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-type">Injective</span></a></span><span> </span><span id="local-6989586621680814892"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680814892"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; Word8 -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#putByte"><span class="hs-identifier hs-var">putByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814893"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; [Bool] -&gt; IO ()
forall a. Binary a =&gt; BinHandle -&gt; a -&gt; IO ()
</span><a href="GHC.Utils.Binary.html#put_"><span class="hs-identifier hs-var">put_</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814893"><span class="hs-identifier hs-var">bh</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680814892"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-2693"></span><span>
</span><span id="line-2694"></span><span>    </span><span id="local-6989586621680814883"><span class="annot"><span class="annottext">get :: BinHandle -&gt; IO Injectivity
</span><a href="#local-6989586621680814883"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span id="local-6989586621680814882"><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814882"><span class="hs-identifier hs-var">bh</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680814881"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621680814881"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO Word8
</span><a href="GHC.Utils.Binary.html#getByte"><span class="hs-identifier hs-var">getByte</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814882"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-2695"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621680814881"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2696"></span><span>                    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Injectivity -&gt; IO Injectivity
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Injectivity
</span><a href="GHC.Core.TyCon.html#NotInjective"><span class="hs-identifier hs-var">NotInjective</span></a></span><span>
</span><span id="line-2697"></span><span>                    </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680814880"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680814880"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BinHandle -&gt; IO [Bool]
forall a. Binary a =&gt; BinHandle -&gt; IO a
</span><a href="GHC.Utils.Binary.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">BinHandle
</span><a href="#local-6989586621680814882"><span class="hs-identifier hs-var">bh</span></a></span><span>
</span><span id="line-2698"></span><span>                            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Injectivity -&gt; IO Injectivity
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Bool] -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-var">Injective</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680814880"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-2699"></span><span>
</span><span id="line-2700"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
           Walking over recursive TyCons
*                                                                      *
************************************************************************

Note [Expanding newtypes and products]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When expanding a type to expose a data-type constructor, we need to be
careful about newtypes, lest we fall into an infinite loop. Here are
the key examples:

  newtype Id  x = MkId x
  newtype Fix f = MkFix (f (Fix f))
  newtype T     = MkT (T -&gt; T)

  Type           Expansion
 --------------------------
  T              T -&gt; T
  Fix Maybe      Maybe (Fix Maybe)
  Id (Id Int)    Int
  Fix Id         NO NO NO

Notice that
 * We can expand T, even though it's recursive.
 * We can expand Id (Id Int), even though the Id shows up
   twice at the outer level, because Id is non-recursive

So, when expanding, we keep track of when we've seen a recursive
newtype at outermost level; and bail out if we see it again.

We sometimes want to do the same for product types, so that the
strictness analyser doesn't unbox infinitely deeply.

More precisely, we keep a *count* of how many times we've seen it.
This is to account for
   data instance T (a,b) = MkT (T a) (T b)
Then (#10482) if we have a type like
        T (Int,(Int,(Int,(Int,Int))))
we can still unbox deeply enough during strictness analysis.
We have to treat T as potentially recursive, but it's still
good to be able to unwrap multiple layers.

The function that manages all this is checkRecTc.
-}</span><span>
</span><span id="line-2746"></span><span>
</span><span id="line-2747"></span><span class="hs-keyword">data</span><span> </span><span id="RecTcChecker"><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-var">RecTcChecker</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="RC"><span class="annot"><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-var">RC</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-2748"></span><span>  </span><span class="hs-comment">-- The upper bound, and the number of times</span><span>
</span><span id="line-2749"></span><span>  </span><span class="hs-comment">-- we have encountered each TyCon</span><span>
</span><span id="line-2750"></span><span>
</span><span id="line-2751"></span><span class="hs-comment">-- | Initialise a 'RecTcChecker' with 'defaultRecTcMaxBound'.</span><span>
</span><span id="line-2752"></span><span class="annot"><a href="GHC.Core.TyCon.html#initRecTc"><span class="hs-identifier hs-type">initRecTc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-type">RecTcChecker</span></a></span><span>
</span><span id="line-2753"></span><span id="initRecTc"><span class="annot"><span class="annottext">initRecTc :: RecTcChecker
</span><a href="GHC.Core.TyCon.html#initRecTc"><span class="hs-identifier hs-var hs-var">initRecTc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; NameEnv Int -&gt; RecTcChecker
</span><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-var">RC</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Core.TyCon.html#defaultRecTcMaxBound"><span class="hs-identifier hs-var">defaultRecTcMaxBound</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span>
</span><span id="line-2754"></span><span>
</span><span id="line-2755"></span><span class="hs-comment">-- | The default upper bound (100) for the number of times a 'RecTcChecker' is</span><span>
</span><span id="line-2756"></span><span class="hs-comment">-- allowed to encounter each 'TyCon'.</span><span>
</span><span id="line-2757"></span><span class="annot"><a href="GHC.Core.TyCon.html#defaultRecTcMaxBound"><span class="hs-identifier hs-type">defaultRecTcMaxBound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-2758"></span><span id="defaultRecTcMaxBound"><span class="annot"><span class="annottext">defaultRecTcMaxBound :: Int
</span><a href="GHC.Core.TyCon.html#defaultRecTcMaxBound"><span class="hs-identifier hs-var hs-var">defaultRecTcMaxBound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">100</span></span><span>
</span><span id="line-2759"></span><span class="hs-comment">-- Should we have a flag for this?</span><span>
</span><span id="line-2760"></span><span>
</span><span id="line-2761"></span><span class="hs-comment">-- | Change the upper bound for the number of times a 'RecTcChecker' is allowed</span><span>
</span><span id="line-2762"></span><span class="hs-comment">-- to encounter each 'TyCon'.</span><span>
</span><span id="line-2763"></span><span class="annot"><a href="GHC.Core.TyCon.html#setRecTcMaxBound"><span class="hs-identifier hs-type">setRecTcMaxBound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-type">RecTcChecker</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-type">RecTcChecker</span></a></span><span>
</span><span id="line-2764"></span><span id="setRecTcMaxBound"><span class="annot"><span class="annottext">setRecTcMaxBound :: Int -&gt; RecTcChecker -&gt; RecTcChecker
</span><a href="GHC.Core.TyCon.html#setRecTcMaxBound"><span class="hs-identifier hs-var hs-var">setRecTcMaxBound</span></a></span></span><span> </span><span id="local-6989586621680814877"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814877"><span class="hs-identifier hs-var">new_bound</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-type">RC</span></a></span><span> </span><span id="local-6989586621680814876"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814876"><span class="hs-identifier hs-var">_old_bound</span></a></span></span><span> </span><span id="local-6989586621680814875"><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814875"><span class="hs-identifier hs-var">rec_nts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; NameEnv Int -&gt; RecTcChecker
</span><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-var">RC</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814877"><span class="hs-identifier hs-var">new_bound</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814875"><span class="hs-identifier hs-var">rec_nts</span></a></span><span>
</span><span id="line-2765"></span><span>
</span><span id="line-2766"></span><span class="annot"><a href="GHC.Core.TyCon.html#checkRecTc"><span class="hs-identifier hs-type">checkRecTc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-type">RecTcChecker</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#RecTcChecker"><span class="hs-identifier hs-type">RecTcChecker</span></a></span><span>
</span><span id="line-2767"></span><span class="hs-comment">-- Nothing      =&gt; Recursion detected</span><span>
</span><span id="line-2768"></span><span class="hs-comment">-- Just rec_tcs =&gt; Keep going</span><span>
</span><span id="line-2769"></span><span id="checkRecTc"><span class="annot"><span class="annottext">checkRecTc :: RecTcChecker -&gt; TyCon -&gt; Maybe RecTcChecker
</span><a href="GHC.Core.TyCon.html#checkRecTc"><span class="hs-identifier hs-var hs-var">checkRecTc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-type">RC</span></a></span><span> </span><span id="local-6989586621680814874"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814874"><span class="hs-identifier hs-var">bound</span></a></span></span><span> </span><span id="local-6989586621680814873"><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814873"><span class="hs-identifier hs-var">rec_nts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680814872"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814872"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-2770"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">NameEnv Int -&gt; Name -&gt; Maybe Int
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814873"><span class="hs-identifier hs-var">rec_nts</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680814870"><span class="hs-identifier hs-var">tc_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2771"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680814869"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814869"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814869"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814874"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe RecTcChecker
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2772"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RecTcChecker -&gt; Maybe RecTcChecker
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; NameEnv Int -&gt; RecTcChecker
</span><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-var">RC</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814874"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameEnv Int -&gt; Name -&gt; Int -&gt; NameEnv Int
forall a. NameEnv a -&gt; Name -&gt; a -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#extendNameEnv"><span class="hs-identifier hs-var">extendNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814873"><span class="hs-identifier hs-var">rec_nts</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680814870"><span class="hs-identifier hs-var">tc_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814869"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2773"></span><span>      </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RecTcChecker -&gt; Maybe RecTcChecker
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; NameEnv Int -&gt; RecTcChecker
</span><a href="GHC.Core.TyCon.html#RC"><span class="hs-identifier hs-var">RC</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680814874"><span class="hs-identifier hs-var">bound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameEnv Int -&gt; Name -&gt; Int -&gt; NameEnv Int
forall a. NameEnv a -&gt; Name -&gt; a -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#extendNameEnv"><span class="hs-identifier hs-var">extendNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680814873"><span class="hs-identifier hs-var">rec_nts</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680814870"><span class="hs-identifier hs-var">tc_name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2774"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-2775"></span><span>    </span><span id="local-6989586621680814870"><span class="annot"><span class="annottext">tc_name :: Name
</span><a href="#local-6989586621680814870"><span class="hs-identifier hs-var hs-var">tc_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680814872"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-2776"></span><span>
</span><span id="line-2777"></span><span class="hs-comment">-- | Returns whether or not this 'TyCon' is definite, or a hole</span><span>
</span><span id="line-2778"></span><span class="hs-comment">-- that may be filled in at some later point.  See Note [Skolem abstract data]</span><span>
</span><span id="line-2779"></span><span class="annot"><a href="GHC.Core.TyCon.html#tyConSkolem"><span class="hs-identifier hs-type">tyConSkolem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-2780"></span><span id="tyConSkolem"><span class="annot"><span class="annottext">tyConSkolem :: TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#tyConSkolem"><span class="hs-identifier hs-var hs-var">tyConSkolem</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isHoleName"><span class="hs-identifier hs-var">isHoleName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; (TyCon -&gt; Name) -&gt; TyCon -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span>
</span><span id="line-2781"></span><span>
</span><span id="line-2782"></span><span class="hs-comment">-- Note [Skolem abstract data]</span><span>
</span><span id="line-2783"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-2784"></span><span class="hs-comment">-- Skolem abstract data arises from data declarations in an hsig file.</span><span>
</span><span id="line-2785"></span><span class="hs-comment">--</span><span>
</span><span id="line-2786"></span><span class="hs-comment">-- The best analogy is to interpret the types declared in signature files as</span><span>
</span><span id="line-2787"></span><span class="hs-comment">-- elaborating to universally quantified type variables; e.g.,</span><span>
</span><span id="line-2788"></span><span class="hs-comment">--</span><span>
</span><span id="line-2789"></span><span class="hs-comment">--    unit p where</span><span>
</span><span id="line-2790"></span><span class="hs-comment">--        signature H where</span><span>
</span><span id="line-2791"></span><span class="hs-comment">--            data T</span><span>
</span><span id="line-2792"></span><span class="hs-comment">--            data S</span><span>
</span><span id="line-2793"></span><span class="hs-comment">--        module M where</span><span>
</span><span id="line-2794"></span><span class="hs-comment">--            import H</span><span>
</span><span id="line-2795"></span><span class="hs-comment">--            f :: (T ~ S) =&gt; a -&gt; b</span><span>
</span><span id="line-2796"></span><span class="hs-comment">--            f x = x</span><span>
</span><span id="line-2797"></span><span class="hs-comment">--</span><span>
</span><span id="line-2798"></span><span class="hs-comment">-- elaborates as (with some fake structural types):</span><span>
</span><span id="line-2799"></span><span class="hs-comment">--</span><span>
</span><span id="line-2800"></span><span class="hs-comment">--    p :: forall t s. { f :: forall a b. t ~ s =&gt; a -&gt; b }</span><span>
</span><span id="line-2801"></span><span class="hs-comment">--    p = { f = \x -&gt; x } -- ill-typed</span><span>
</span><span id="line-2802"></span><span class="hs-comment">--</span><span>
</span><span id="line-2803"></span><span class="hs-comment">-- It is clear that inside p, t ~ s is not provable (and</span><span>
</span><span id="line-2804"></span><span class="hs-comment">-- if we tried to write a function to cast t to s, that</span><span>
</span><span id="line-2805"></span><span class="hs-comment">-- would not work), but if we call p @Int @Int, clearly Int ~ Int</span><span>
</span><span id="line-2806"></span><span class="hs-comment">-- is provable.  The skolem variables are all distinct from</span><span>
</span><span id="line-2807"></span><span class="hs-comment">-- one another, but we can't make assumptions like &quot;f is</span><span>
</span><span id="line-2808"></span><span class="hs-comment">-- inaccessible&quot;, because the skolem variables will get</span><span>
</span><span id="line-2809"></span><span class="hs-comment">-- instantiated eventually!</span><span>
</span><span id="line-2810"></span><span class="hs-comment">--</span><span>
</span><span id="line-2811"></span><span class="hs-comment">-- Skolem abstractness can apply to &quot;non-abstract&quot; data as well):</span><span>
</span><span id="line-2812"></span><span class="hs-comment">--</span><span>
</span><span id="line-2813"></span><span class="hs-comment">--    unit p where</span><span>
</span><span id="line-2814"></span><span class="hs-comment">--        signature H1 where</span><span>
</span><span id="line-2815"></span><span class="hs-comment">--            data T = MkT</span><span>
</span><span id="line-2816"></span><span class="hs-comment">--        signature H2 where</span><span>
</span><span id="line-2817"></span><span class="hs-comment">--            data T = MkT</span><span>
</span><span id="line-2818"></span><span class="hs-comment">--        module M where</span><span>
</span><span id="line-2819"></span><span class="hs-comment">--            import qualified H1</span><span>
</span><span id="line-2820"></span><span class="hs-comment">--            import qualified H2</span><span>
</span><span id="line-2821"></span><span class="hs-comment">--            f :: (H1.T ~ H2.T) =&gt; a -&gt; b</span><span>
</span><span id="line-2822"></span><span class="hs-comment">--            f x = x</span><span>
</span><span id="line-2823"></span><span class="hs-comment">--</span><span>
</span><span id="line-2824"></span><span class="hs-comment">-- This is why the test is on the original name of the TyCon,</span><span>
</span><span id="line-2825"></span><span class="hs-comment">-- not whether it is abstract or not.</span><span>
</span><span id="line-2826"></span></pre></body></html>